-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
41 lines (35 loc) · 1008 Bytes
/
lefthook.yml
File metadata and controls
41 lines (35 loc) · 1008 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
36
37
38
39
40
41
# Lefthook configuration
# Install: go install github.com/evilmartians/lefthook@latest
# Setup: lefthook install
pre-commit:
parallel: true
commands:
gofmt:
glob: "*.go"
run: gofmt -l -w {staged_files}
stage_fixed: true
govet:
glob: "*.go"
run: go vet ./...
golangci-lint:
glob: "*.go"
run: golangci-lint run --timeout=5m
structlint:
run: structlint validate --config .structlint.yaml --silent
pre-push:
commands:
govulncheck:
run: govulncheck ./...
commit-msg:
commands:
commitlint:
run: |
msg=$(cat {1})
if ! echo "$msg" | grep -qE "^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?(!)?: .+"; then
echo "Error: Commit message must follow conventional commits format"
echo "Examples:"
echo " feat: add new feature"
echo " fix(sandbox): resolve namespace issue"
echo " docs: update README"
exit 1
fi