-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
35 lines (30 loc) · 781 Bytes
/
lefthook.yml
File metadata and controls
35 lines (30 loc) · 781 Bytes
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
34
35
pre-commit:
parallel: true
commands:
golangci-lint:
glob: '*.go'
run: golangci-lint run --fix
stage_fixed: true
go-test-short:
run: task test-short
skip:
- merge
- rebase
pre-push:
commands:
go-test:
run: task test
go-build:
run: task build
commit-msg:
commands:
conventional-commit:
run: |
msg=$(cat {1})
if ! printf '%s' "$msg" | grep -qE '^(feat|fix|docs|style|refactor|perf|test|chore|ci|build)(\(.+\))?: .{1,}$'; then
echo 'ERROR: Commit message must follow Conventional Commits format:'
echo ' type(scope?): subject'
echo
echo 'Valid types: feat, fix, docs, style, refactor, perf, test, chore, ci, build'
exit 1
fi