1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/sh
#
# Futhark pre-commit hook for quality-checking the commit.
#
# This hook checks the following:
#
# * Trailing whitespace.
# * Runs hlint.
# * Tries to compile Futhark.
#
# It also yells at you to run the test suite, although it doesn't do
# it by itself.
initial=c508f9f531929f6bed868243334417ef6c840cb4 # Hash of initial commit.
fail() {
echo "Aborting commit due to verification errors."
echo "If you disagree, use git commit --no-verify."
exit 1
}
echo Quality-checking commit...
echo
make check-commit || fail
make build || fail
|