SolutionGuidance / psm

Welcome to the Medicare/Medicaid Provider Enrollment Screening Portal
http://projectpsm.org/
Other
26 stars 20 forks source link

WIP: Add groovy linter #1076

Closed jasonaowen closed 5 years ago

jasonaowen commented 5 years ago

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

./gradlew codenarcTest

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 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.

Issue #456 Use consistent code style

frankduncan commented 5 years ago

Closed to clean up open PR list, but tracked in #1086