Skip to content

Commit

Permalink
Automatically format when 'verify' script is run
Browse files Browse the repository at this point in the history
This update changes the 'verify' script to also
run 'spotlessApply'. This automatically fixes any
formatting issues.

Meanwhile, we also update the CI build to skip the
'spotlessApply' task. This means if a developer
runs 'verify', they will automatically get formatting
fixes; but if a branch with formatting problems is pushed
it would fail the build.

For context, the `verify` script is run by CI to run
all build verifications (AKA: checks, tests). This
same script can be run by a developer as-is on their
system to test their local branch.
  • Loading branch information
DanVanAtta committed Nov 28, 2023
1 parent 243a68f commit bef1625
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ jobs:
distribution: temurin
java-version: 11
- name: Run Build Checks
run: ./verify
# We skip 'spotlessApply' such that only 'spotlessCheck' will run to validate formatting.
# This is a good setup for a CI server, meanwhile if a developer runs 'verify', they
# will have the 'spotlessApply' task run and it will automatically format the code.
run: ./verify --exclude-task spotlessApply
2 changes: 1 addition & 1 deletion verify
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ set -o pipefail
set -eu

checkDependency "docker" || installDocker
"$scriptDir/gradlew" check $@
"$scriptDir/gradlew" spotlessApply check $@
"$scriptDir/.build/find-unused-dbunit-datasets"
"$scriptDir/.build/code-convention-checks/check-custom-style" spitfire-server

0 comments on commit bef1625

Please sign in to comment.