Adds opt-in precommit hook to check formatting. (#483)

This commit is contained in:
J Logan authored and GitHub committed 2026-01-21 11:34:16 -08:00
1 parent ce0963f693
commit dadfdcefae
5 files changed
+116 -14

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
#! /bin/bash -e
setup_error() {
echo failed to run: $1 1>&2
echo run '"make pre-commit"' and try again 1>&2
exit 1
}
if [ ! -z "${PRECOMMIT_NOFMT}" ] ; then
exit 0
fi
echo checking formatting and licenses 1>&2
project_pathname=$(git rev-parse --show-toplevel)
cd "${project_pathname}"
make check