We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a33e8f commit eefc764Copy full SHA for eefc764
1 file changed
git-hooks/pre-push
@@ -0,0 +1,18 @@
1
+#! /bin/bash
2
+
3
+# Copy this to .git/hooks to use it
4
+# However, there is already a recipe for git-hooks in justfile that
5
+# creates a pre-push with `just test`
6
7
+# Run pytest
8
+echo "Testing..."
9
+pytest
10
+TEST_EXIT_CODE=$?
11
12
+if [ $TEST_EXIT_CODE -ne 0 ]; then
13
+ echo "Tests failed with exit code $TEST_EXIT_CODE. Cannot proceed with the push."
14
+ exit 1
15
+fi
16
17
+echo "Tests passed. Proceeding with the push."
18
+exit 0
0 commit comments