-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using a codenarc ruleset file seems to fail / groovylintrc is not codenarc compatible #62
Comments
i also noticed that codenarc doesn't have very nice in-line ignores for issues in code, which npm-groovy-lint is solving, i'm starting to lean towards using npm-groovy-lint exclusively in the build / dev process, but having a pre-built docker image in dockerhub that has everything needed for running npm-groovy-lint would be really nice so i could just pull that, mount my code and run |
I let available the use of CodeNarc rulesets, but only when --codenarcargs are used, else npm-groovy-lint architecture requires a .groovylintrc.json file About docker image... I unfortunately don't have a Linux available on my good old Windows, but if you want to create one, be my guest , I'm waiting frolm your PR :) It requires only Java 8 / 11 and Node >= 12, so the dockerfile would be something like ->
|
I think having the option of using codenarc rulesets would be beneficial even if we decide to not use them at the moment. At least if you can figure out why they don't work may reveal something else. Linux subsystem for windows works great, also VM's (i use them myself). You using windows may explain why --fix adds CRLF line-endings to all my files when it tries to re-indent them. I'll file a new bug for that one. |
In the latest version you have docker image thanks to Dave, a generous contributor, and I also fixed the RuleSet files issue :) Plz reopen if you see any issue :) |
Codenarc has native gradle-support which makes it simple to integrate into the build, npm-groovy-lint has vscode support and otherwise superior user experience in command line reporting.
However the
.groovylintrc.json
file isn't compatible with CodeNarc.Integrating npm-groovy-lint to the build process is not necessarily a huge issue, but it requires creating a custom docker-image (i couldn't see one directly available in dockerhub) and some extra logic. CodeNarc is a bit more straightforward as you can call it from Gradle.
I would like to be able to share the rules of CodeNarc with npm-groovy-lint so that i don't have to maintain them in two different files for both tools.
I can use a groovy rule set file directly with codenarc as configuration, npm-groovy-lint appears to have support for CodeNarc configuration files based on the help text.
But when I try to pass the same file as a codenarc config file for npm-groovy-lint as a codenarc parameter it just fails.
I had to remove that .txt from the end to get npm-groovy-lint to react to it, but when I run
npm-groovy-lint -r StarterRuleSet-AllRulesByCategory.groovy
then I tried commenting out that ImplicitReturnStatement rule, i get
Having the npm-groovy-lint (and the VSCode plugin) rule configuration be directly compatible and usable with CodeNarc could also solve the problem so I wouldn't have to make a choice between the two: use one for development / IDE integration and then run codenarc in CI.
The text was updated successfully, but these errors were encountered: