Really appreciate the efforts that already went into super-lint, it would be great to also add support for Java using perhaps one of the following linters:
Using https://github.com/diffplug/spotless
one could simultaneously and seamlessly supports formatting for Java, Kotlin, scala and SQL :}
I think this is strongly important because Java is more and more used with complementary languages.
Java is still up there as one of the most used languages. Java linting would be a great addition
Is it known when such language additions will be considered? I'm guessing this is not the priority. What _is_ the priority?
It looks to me like this is important to many people based on the comments and 👍 here. As far as I am concerned, Java support is ready to work on. We have created some useful information to consider when adding support for new languages like Java on the wiki.
Anyone who would like to can pick up this work by starting a PR in draft mode and mention this issue. We will be there to help along the way.
I would like to work on this. I'll make a PR when I'm done.
Which linter should I implement? SpotBugs, Spotless, PMD or Checkstyle? Which one?
Spotless looks like a good one after a quick glance but I'm not a regular Java developer so I would yield to others if they have opinions.
I would like to work on this. I'll make a PR when I'm done.
Thank you @quackduck!! ✨ 🎉
I'll work on Spotless, for now, then.
@quackduck nice to know you're working on it!
Please if possible, make sure to use their "modern" gradle plugin and not the old one.
The modern one should be more optimized ->
https://github.com/diffplug/spotless/issues/600
Sorry for taking so much time to get back to this.
I made a PR - #459. Have a look!
I'm not sure how I should continue. I've never used Gradle or Docker. If I'm not mistaken, the PR wouldn't work because we haven't given Docker a command to install Spotless, right?
@quackduck I'm a noob at docker so I cannot really help you :/
Maybe that you could take inspiration from the PR for Kotlin?
https://github.com/github/super-linter/pull/246
@admiralAwkbar
@Kim1Jun
You might give some hints and be interested as it would allow Kotlin Klint support through spotless which would be a more modern gradle integration and allow things beyond what Ktlint can do and enable better Java interop.
Thanks! I’ll have a look. I don’t know Gradle though. Lemme see what I can learn from #246
On 22 Jul 2020, at 3:13 PM, LifeIsStrange notifications@github.com wrote:
@quackduck https://github.com/quackduck I'm a noob at docker so I cannot really help you :/
Maybe that you could take inspiration from the PR for Kotlin?246 https://github.com/github/super-linter/pull/246
@admiralAwkbar https://github.com/admiralAwkbar
@Kim1Jun https://github.com/Kim1Jun
You might give some hints and be interested as it would allow Kotlin Klint support through spotless which would be a more modern gradle integration and allow things beyond what Ktlint can do and enable better Java interop.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/github/super-linter/issues/115#issuecomment-662394307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJIU2R4Z7TDCVUPLNITVSLDR43CVHANCNFSM4OB52LDQ.
Anyone who uses Gradle or knows how we can add Spotless feel free to make suggestions (Can there be 2 contributors in a PR? If so, we could do that.)
@quackduck let me have look see
I should state that I've never used spotless before, but I can help with the docker part.
Spotless seem to be only available within gradle or maven. Which adds a bit of complexity as you need to have gradle or maven installed inside the container, then you would clone the git repo for spotless, then you would need to have a configuration file with the require settings to run the linter locally. Spotless has a high level document on running locally here. There are probably a lot more steps to get this working required and there would be a whole set of options that could be added as spotless seems really powerful.
Just to add doesn't seem like running Spotless without gradle/ maven would be possible
So what do you think I should do? I have no experience with Gradle, Maven or Docker 😐
Do you need Gradle or Maven to be able to help with the Docker part?
Spotless does have support for many languages.
I don't think it would be easy to progress Spotless without having some input from someone who uses Spotless.
I had a quick look at PMD and Checkstyle, both these have options to run from the command line. This might be easy to get up, Checkstyle even gives you the list of commands that you need to run:
$ cd $HOME
$ wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.25.0/pmd-bin-6.25.0.zip
$ unzip pmd-bin-6.25.0.zip
$ alias pmd="$HOME/pmd-bin-6.25.0/bin/run.sh pmd"
$ pmd -d /usr/src -R rulesets/java/quickstart.xml -f text
If you give me access to your fork and pull request I can help out with the Docker stuff
Done! I gave you access.
@quackduck @sirReeall awesome work here. Let me know when it gets closer so i can poke around and see fi i can help :)
Ended up with checkstyle as it give you Sun Code Conventions and Google Java Style OOTB.
@quackduck Have a look at my commit here.
It has some magic in the command to make sure the latest release is pulled into the image.
Tested this on a local image and I can run java -jar /usr/bin/checksytle.jar to fire it up.
This will need plumbing into super-linter's code now. Let me know if you need any help with that
@quackduck how's it going? Did you need any help with this?
What do you mean by plumbing? By the way, have a look at my new commit
looks good, made one small adjustment to the LINTER_CMD as you must specify rules that you will use
Is that it then?
Also, when you're installing the jar, does the name of the jar have the checkstyle version? If so, we should either remove the version from the name or add the version to the linter command
Noob question:
How do I add "labels" to my PR? Like the stuff that says enhancement and all that
How do I add "labels" to my PR? Like the stuff that says enhancement and all that
@quackduck
On an Issue or Pull Request, these are called labels. This is the relevant documentation.
You need to have write access to the repository however, so only maintainers can apply labels to issues and PRs in their repo.
If you try in a personal repository or one you have write access to, you should see the option to on the right side of the screen.
Oh okay. Thanks!
Most helpful comment
Using https://github.com/diffplug/spotless
one could simultaneously and seamlessly supports formatting for Java, Kotlin, scala and SQL :}
I think this is strongly important because Java is more and more used with complementary languages.