-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
33 lines (32 loc) · 1.11 KB
/
Copy pathlefthook.yml
File metadata and controls
33 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pre-commit:
parallel: true
commands:
build:
run: go build ./...
fmt-check:
run: test -z "$(gofmt -l {staged_files})" || (gofmt -l {staged_files} && echo "Run 'gofmt -w .' to fix formatting" && exit 1)
glob: "*.go"
vet:
run: go vet ./...
test:
run: go test ./...
commit-msg:
commands:
conventional-commit:
run: |
msg=$(head -1 {1})
if ! echo "$msg" | grep -qE '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?(!)?: .+'; then
echo ""
echo "Invalid commit message: $msg"
echo ""
echo "Must follow Conventional Commits format:"
echo " <type>[optional scope][!]: <description>"
echo ""
echo "Types: feat | fix | docs | style | refactor | perf | test | build | ci | chore | revert"
echo "Examples:"
echo " feat: add ticket export command"
echo " fix(auth): handle expired OAuth tokens"
echo " docs: update README with install instructions"
echo " feat!: remove deprecated search flags"
exit 1
fi