Skip to content

Commit d71b2ea

Browse files
committed
fix: Conserta checagem no githook de pre-push
1 parent 37cb80e commit d71b2ea

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

.githooks/pre-push

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
warning() {
4-
# shellcheck disable=2028
5-
echo "\\e[1;33m$1"
3+
handle_failure() {
4+
echo "❌ Error: $1 failed!"
5+
exit 1
66
}
77

8-
alertMessages() {
9-
warning "One or more $1 are failing."
10-
warning "Please fix those $1 before pushing your branch"
11-
}
8+
echo "🔍 Running lint checks..."
9+
make lint || handle_failure "lint"
1210

13-
if make lint; then
14-
if make test-coverage; then
15-
exit 0
16-
else
17-
alertMessages "unit tests"
18-
exit 1
19-
fi
20-
else
21-
alertMessages "linter checks"
22-
exit 1
23-
fi
11+
echo "🧪 Running test coverage..."
12+
make test-coverage || handle_failure "test-coverage"
13+
14+
echo "✅ All checks passed successfully!"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test:
4646

4747
.PHONY: test-coverage
4848
test-coverage:
49-
@docker compose run --rm -v ${ROOT}:/app \
49+
@docker compose run --rm -T -v ${ROOT}:/app \
5050
--name ${TEST_CONTAINER_NAME} ${APP_NAME} \
5151
/bin/bash -c "pytest --cov=validate_docbr/"
5252

0 commit comments

Comments
 (0)