We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c27e105 commit f5bf22eCopy full SHA for f5bf22e
hooks/pre-commit
@@ -0,0 +1,18 @@
1
+#! /bin/bash
2
+
3
+set -e
4
+find . -name "*.go" -exec go fmt {} \;
5
+# Check for untracked files
6
+if [[ -n $(git ls-files --others --exclude-standard) ]]; then
7
+ echo "❌ Commit blocked: There are untracked files."
8
+ echo "Run 'git add <file>' to track them or .gitignore if intentional."
9
+ exit 1
10
+fi
11
12
+# Check for unstaged changes in tracked files
13
+if [[ -n $(git diff --name-only) ]]; then
14
+ echo "❌ Commit blocked: There are unstaged changes in tracked files."
15
+ echo "Run 'git add <file>' to stage them."
16
17
18
+go test -v ./...
setup
@@ -0,0 +1,3 @@
+cp hooks/* .git/hooks
0 commit comments