Add pre-commit hook to repo

This commit is contained in:
Joshua Boniface 2020-11-07 15:32:56 -05:00
parent aa6f088a3e
commit 34ce3bf3f8
1 changed files with 16 additions and 0 deletions

16
.hooks/pre-commit Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
pushd $( git rev-parse --show-toplevel ) &>/dev/null
ex=0
# Linting
./lint
if [[ $? -ne 0 ]]; then
echo "Aborting commit due to linting errors."
ex=1
fi
echo
popd &>/dev/null
exit $ex