Added pre-commit hook

This commit is contained in:
Jef Roosens 2020-08-28 13:15:08 +02:00
parent c9700618f7
commit 5855c931ca
2 changed files with 24 additions and 2 deletions

11
.githooks/pre-commit Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
#
# This hooks runs tests and checks if the linter doesn't hate you
# Linting
printf "flake8....."
make lint > /dev/null 2>&1 && printf "OK!\n" || { printf "Fail." && exit 1; }
# Running tests
printf "pytest....."
make test > /dev/null 2>&1 && printf "OK!\n" || { printf "Fail." && exit 1; }