Skip to content

Commit 4683135

Browse files
committed
fix pre-push
1 parent 54a37af commit 4683135

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.githooks/pre-push

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
REPO_ROOT="$(git rev-parse --show-toplevel)"
55
GITHOOKS_DIR="$REPO_ROOT/.githooks"
66

7+
# Track failures
8+
FAILED=0
9+
710
echo "========================================"
811
echo " Pre-Push Checks"
912
echo "========================================"
@@ -18,13 +21,13 @@ if [[ -n "$python_changed_files" ]]; then
1821
echo " ${python_changed_files[*]}"
1922
echo
2023
echo " [1/3] Formatting and linting..."
21-
bash "$GITHOOKS_DIR/pre-push-python/fmt-lint.sh"
24+
bash "$GITHOOKS_DIR/pre-push-python/fmt-lint.sh" || FAILED=1
2225

2326
echo " [2/3] Stub generation..."
24-
bash "$GITHOOKS_DIR/pre-push-python/stubs.sh"
27+
bash "$GITHOOKS_DIR/pre-push-python/stubs.sh" || FAILED=1
2528

2629
echo " [3/3] Extras validation..."
27-
bash "$GITHOOKS_DIR/pre-push-python/extras.sh"
30+
bash "$GITHOOKS_DIR/pre-push-python/extras.sh" || FAILED=1
2831
echo
2932
else
3033
echo " (none)"
@@ -39,14 +42,21 @@ if [[ -n "$bindings_changed_files" ]]; then
3942
echo " ${bindings_changed_files[*]}"
4043
echo
4144
echo " [1/1] Stub generation..."
42-
bash "$GITHOOKS_DIR/pre-push-rust/stubs.sh"
45+
bash "$GITHOOKS_DIR/pre-push-rust/stubs.sh" || FAILED=1
4346
echo
4447
else
4548
echo " (none)"
4649
echo
4750
fi
4851

49-
echo "========================================"
50-
echo " ✓ All checks passed"
51-
echo "========================================"
52+
if [[ $FAILED -eq 1 ]]; then
53+
echo "========================================"
54+
echo " ✗ Some checks failed"
55+
echo "========================================"
56+
exit 1
57+
else
58+
echo "========================================"
59+
echo " ✓ All checks passed"
60+
echo "========================================"
61+
fi
5262

0 commit comments

Comments
 (0)