1
0
mirror of https://github.com/google/nomulus synced 2025-12-23 06:15:42 +00:00

Terminate with exit code of 1 on format check fail (#1570)

The format check script currently outputs "true" if there were files that need
reformatting and "false" if not, which is useful for gradle but less so for
other applications (notably commit hooks).  Terminate with an exit code of 1
if the format check fails.

TESTED: Tried this from both a pre-commit hook and from the gradle build.
This commit is contained in:
Michael Muller
2022-03-25 12:50:27 -04:00
committed by GitHub
parent 3006ca39ca
commit 3592877210

View File

@@ -139,10 +139,11 @@ function isJavaFormatNeededOnDiffs() {
if [[ ${modifiedLineCount} -ne 0 ]]; then
echo "true"
exit 1
else
echo "false"
exit 0
fi
exit 0
}
# The main function of this script: