Add Spotless to the build to check and apply the Google code style.
During the Maven clean phase, spotless:check is called. This makes PRs fail quickly if somehow code was submitted without formatting. This generally shouldn't hit affect dev workflows, though they can resolve any errors by running mvn validate or manually calling mvn spotless:apply and then doing the clean again.
During the Maven validate phase, spotless:apply is called. This keeps local code formatted as expected throughout the dev process. (In VS Code as I was testing this, it was making it hard to actually keep unformatted files on disk at all!)
For code review, please notice the 3 commits are meaningful:
707cd40b3e38309d3da04f314752461f39c3d9b9 changes pom.xml and the docs.
bf84710319108cc2f841dd5e773702bd83a95392 is just the files under utam-compiler that were changed by spotless:apply. No manual changes were applied.
5c1be0e9682908deaa191b1ba9ca06961f74e9e7 is just the files under utam-core that were changed by spotless:apply. No manual changes were applied.
To QA:
Notice the first commit failed the CI build because files were not formatted.
Create a local temp branch from dev and cherry-pick the first commit here.
Run mvn spotless:apply and notice 293 files were changed.
Merge this branch into your temporary branch and see all pending changes are resolved, showing that the files in this PR are the complete and automatic set of changes.
Add Spotless to the build to check and apply the Google code style.
During the Maven
clean
phase,spotless:check
is called. This makes PRs fail quickly if somehow code was submitted without formatting. This generally shouldn't hit affect dev workflows, though they can resolve any errors by runningmvn validate
or manually callingmvn spotless:apply
and then doing the clean again.During the Maven
validate
phase,spotless:apply
is called. This keeps local code formatted as expected throughout the dev process. (In VS Code as I was testing this, it was making it hard to actually keep unformatted files on disk at all!)For code review, please notice the 3 commits are meaningful:
pom.xml
and the docs.utam-compiler
that were changed byspotless:apply
. No manual changes were applied.utam-core
that were changed byspotless:apply
. No manual changes were applied.To QA:
dev
and cherry-pick the first commit here.mvn spotless:apply
and notice 293 files were changed.