Add pre-push git hook to run tests

This commit is contained in:
Chemaclass
2023-03-08 19:17:04 +00:00
parent 62497fd270
commit ce70dd26be
3 changed files with 25 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
echo "*********************************************************"
echo "Running git pre-commit hook. Running Static analysis... "
echo "*********************************************************"
./gradlew ktlintCheck
status=$?
if [ "$status" = 0 ] ; then
echo "Static analysis found no problems."
exit 0
else
echo "*********************************************************"
echo 1>&2 "Static analysis found violations it could not fix."
printf "Run ${GREEN}./gradlew ktlintFormat${NO_COLOR} to fix formatting related issues...\n"
echo "*********************************************************"
exit 1
fi