Add linter and enforce it in CI#129
Merged
Merged
Conversation
4fb91e8 to
38f8609
Compare
Collaborator
Author
|
@ngraves95 feel free to push back on this if you have another preferred option for linting/formatting - also add or remove the rules/lints from the checkstyle.xml (docs). The only thing that checkstyle seems to lack which I would miss is unused static imports :( it's unfortunatly listed as something that cannot be supported https://checkstyle.sourceforge.io/checks/imports/unusedimports.html |
4f3ce9c to
2d8cc1a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I've noticed for a while that the code is inconsistent in it's styling and formatting, ideally to reduce general overhead in every diff I opine that a strict linter and formatter is much better than having to tell people during a pull request to "fix their formatting".
This PR does that by adding a checkstyle config and the gradle plugin. I specifically pinned it to version as according to the docs:
As we use
targetCompatibility: 1.11this is JRE 11 so therefore we should use a checkstyle of10.xhence I just set it as the latest that was released at the time of writing10.26.1.Doing it this was means that any IDE should work AND that CI will automatically tell any user that their change has issues.
Testing
Checkout the source files back to master, then run the linter/formatter (all the errors).