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 914b795232
commit b98822c17a

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: