The list of rules needs to be cut down for our project! This PR is not ready to merge yet. Some of the warnings it raises are legitimate, and we should fix them; others are a configuration error, or at least a difference of opinion.
Once this PR is merged, we should add the job to our CI; look at the existing Checkstyle job definition for a template. We'll probably also want to figure out how to present the reports in a useful fashion; there isn't obviously a way to make it generate Checkstyle XML reports. Adding the line reportFormat = 'console' in the codeNarc { block might be a reasonable compromise.
As this work is incomplete, I encourage you, dear reviewer, to either complete it or close the PR; I'm afraid I won't be able to dedicate the time to do either.
Add codenarc to allow us to enforce a consistent style in our groovy code (in particular, in our Spock tests).
The current list of checks is a slightly cut down version of their example list.
You can run the linter by
See also the gradle plugin documentation.
The list of rules needs to be cut down for our project! This PR is not ready to merge yet. Some of the warnings it raises are legitimate, and we should fix them; others are a configuration error, or at least a difference of opinion.
Once this PR is merged, we should add the job to our CI; look at the existing Checkstyle job definition for a template. We'll probably also want to figure out how to present the reports in a useful fashion; there isn't obviously a way to make it generate Checkstyle XML reports. Adding the line
reportFormat = 'console'
in thecodeNarc {
block might be a reasonable compromise.As this work is incomplete, I encourage you, dear reviewer, to either complete it or close the PR; I'm afraid I won't be able to dedicate the time to do either.
Issue #456 Use consistent code style