From 9e105a9a99b2f6164af6aa60717e950bb563e3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Paiva?= Date: Sat, 24 Feb 2024 20:14:09 -0300 Subject: [PATCH] chore: Adiciona git hook para pre-push --- .githooks/pre-push | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 .githooks/pre-push 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