Add better instructions for re-formatting the project #4540
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.
The style check I've added has caused some confusion for 2 reasons:
Specifically, I mentioned in the original spotless PR that the check that is run first runs the code generators, then runs spotless. In later comments and in
CONTRIBUTING.md
, however, I said that running./mvnw spotless:apply
would fix style errors. This was not correct and I did not consider that the code generators would introduce style changes that wouldn't be "fixed" by spotless.There have been a few cases where the generators have made whitespace changes that weren't changed by spotless, however, and the instructions I gave also don't give any guidance in cases where there are legitimate codegen issues (for example if someone implemented a method manually when it should've been generated), so I've updated the instructions in
CONTRIBUTING.md
to be much more clear (and correct) about what's required.I also mentioned creating a custom maven command (for example
./mvnw format
) to make this process simpler for contributors, but this would only work on systems withbash
available and isn't much simpler than running the code generators in any case. I think just having better instructions available is a better solution.