From e2493e7b1966d4f50548eed3c6d4c1e126ea85e7 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Fri, 2 Apr 2021 14:06:23 +0200 Subject: [PATCH] Updated pre-commit hook to run tests on important branches (#2) --- .hooks/pre-commit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.hooks/pre-commit b/.hooks/pre-commit index 32d1be5..0072f2c 100755 --- a/.hooks/pre-commit +++ b/.hooks/pre-commit @@ -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