upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/git_hooks
diff options
context:
space:
mode:
Diffstat (limited to 'git_hooks')
-rw-r--r--[-rwxr-xr-x]git_hooks/pre-commit6
-rwxr-xr-xgit_hooks/pre-push24
2 files changed, 24 insertions, 6 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit
index 63b191d..5ec9f01 100755..100644
--- a/git_hooks/pre-commit
+++ b/git_hooks/pre-commit
@@ -15,10 +15,4 @@ then
15 exit 1 15 exit 1
16fi 16fi
17 17
18if ! cargo test
19then
20 echo "There are some test issues."
21 exit 1
22fi
23
24exit 0 \ No newline at end of file 18exit 0 \ No newline at end of file
diff --git a/git_hooks/pre-push b/git_hooks/pre-push
new file mode 100755
index 0000000..63b191d
--- /dev/null
+++ b/git_hooks/pre-push
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3set -eu
4
5if ! cargo fmt -- --check
6then
7 echo "There are some code style issues."
8 echo "Run cargo fmt first."
9 exit 1
10fi
11
12if ! cargo clippy --all-targets -- -D warnings
13then
14 echo "There are some clippy issues."
15 exit 1
16fi
17
18if ! cargo test
19then
20 echo "There are some test issues."
21 exit 1
22fi
23
24exit 0 \ No newline at end of file