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 27 28 29 30 31 32 33 34 35 36 37
|
#!/bin/bash
# link this file in your git-hooks, for example with:
# ln .git/hooks/pre-commit pre-commit
if ./scripts/format.sh check
then
echo "nothing to format"
else
echo "unformatted files, please format and stage again" >&2
exit 1
fi
if lizard include lib app test &> "/dev/null"; then
echo "no overcomplicated functions found"
else
echo "lizard-warnings found... aborting" >&2
exit 1
fi
cd "build/debug"
if ninja ;then
echo "debug-build successfull"
else
echo "build-failure... aborting" >&2
exit 2
fi
cd "../.."
cd "build/debug"
if ninja test &> "/dev/null";then
echo "unit-tests run succesfully"
else
echo "unit-tests failed... aborting" >&2
exit 2
fi
cd "../.."
|