Updated pre-commit hook to run tests on important branches

(#2)
master^2
Jef Roosens 2021-04-02 14:06:23 +02:00
parent 6acbb4ad62
commit e2493e7b19
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
1 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,14 @@
#!/usr/bin/env bash
# This hook lints the code, and if we're on develop or master, also forces the tests to pass.
branch=`git rev-parse --abbrev-ref HEAD`
# Just lint the code before committing
make lint
# TODO should we add release branches here as well?
if [[ "$branch" =~ ^master|develop$ ]]; then
make test
fi