Skip to content

Commit

Permalink
chore: Adiciona git hook para pre-push
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarofpp committed Feb 24, 2024
1 parent 922c535 commit 9e105a9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9e105a9

Please sign in to comment.