Java Code is formatted using the Google Java Style Guide. We use spotless to check and fix formatting on files changed by the branch. It will run on build and CI will check that it's been run.
We recommend adding the pre-push hook to check formatting before pushing to GitHub.
./gradlew spotlessInstallGitPrePushHookTo check if the code is formatted correctly:
./gradlew spotlessCheckTo fix the code formatting (also runs on build):
./gradlew spotlessApplyWhile the spotless formatting is the source of truth for what is correct. You can set up your editor to directly use the google-java-format so functions like format on save are available.