diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..29f859c --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,23 @@ +#!/bin/sh + +warning() { + # shellcheck disable=2028 + echo "\\e[1;33m$1" +} + +alertMessages() { + warning "One or more $1 are failing." + warning "Please fix those $1 before pushing your branch" +} + +if make lint; then + if make test-coverage; then + exit 0 + else + alertMessages "unit tests" + exit 1 + fi +else + alertMessages "linter checks" + exit 1 +fi