-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
43 lines (36 loc) · 1 KB
/
lefthook.yml
File metadata and controls
43 lines (36 loc) · 1 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
34
35
36
37
38
39
40
41
42
43
# ==============================================================================
# Lefthook Configuration
# ==============================================================================
pre-commit:
parallel: true
commands:
format-go:
glob: "**/*.go"
run: |
gofmt -w {staged_files}
git add {staged_files}
stage_fixed: true
lint-go-fast:
glob: "**/*.go"
run: go vet ./...
tidy-go-mod:
glob: "{go.mod,go.sum}"
run: go mod tidy && git add go.mod go.sum
check-secrets-basic:
run: |
if git diff --cached | grep -iE '(api_key|secret_key|password|token)["\s]*[:=]["\s]*[a-zA-Z0-9]{8,}'; then
echo "Error: Potential secret detected in staged changes"
exit 1
fi
commit-msg:
commands:
validate-conventional-commits:
run: cog verify --file {1}
pre-push:
commands:
test-go:
glob: "**/*.go"
run: go test ./...
build-go:
glob: "**/*.go"
run: go build -o /dev/null .