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.
This PR adds checkstyle to the build, to help minimise the amount of churn of e.g. import statements. The config is adapted from the default Sun style, with changes made to match our current codebase.
Where I have been able to get a "quick win" to adopt a consistent style then that is included within this PR (e.g. adding comments to
public static final
fields and making themUPPER_CASE
, tweaking whitespace around operators, tweaking imports).Where it's not feasible to apply the rule yet or the rule is in default sun style but might not be relevant / applicable to our project, I have added it to the suppressions (exceptions) file. Preferably these suppressions are limited to the relevant files, but there are some rules added as a global supression.
It's a TODO for future PRs to investigate whether the remaining "suppressed" checks are applicable or if they definitely don't apply / we don't care.
For example, there are lots of warnings about magic numbers where we use
31
in thehashCode()
methods - maybe one day we will convert them all to useObjects.hashCode(...)
but perhaps not right now and certainly not within this PR. Ditto for ensuring there is javadoc for all public methods/classes - this is something we probably should be doing, but there are too many places we don't have this that it's a substantial piece of work (assuming we want to do it - again a separate discussion / PR 👍 ).