-
Notifications
You must be signed in to change notification settings - Fork 11
/
.husky.toml
39 lines (33 loc) · 1.03 KB
/
.husky.toml
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
# version-file which will write or read current semver
version-file = "internal/version/version"
# hook scripts
[hooks]
# after version calc,
# with use the {{ .Version }} to upgrade other files.
post-version = [
"sed -i -e 's/\"version\": \"[^\"]*\"/\"version\": \"{{ .Version }}\"/g' testdata/pacakge.json",
"sed -i -e 's/version: [^\\n]*/version: {{ .Version }}/g' testdata/pubspec.yaml"
]
# git hook pre commit
pre-commit = [
"golangci-lint run",
"husky lint-staged",
]
# git hook commit msg
commit-msg = [
"husky lint-commit",
]
# list staged files do some pre-process and git add
[lint-staged]
"*.go" = [
"goimports -l -w",
"gofmt -l -w",
]
# commit msg rule default support conventional commits
[lint-commit]
# could check if this exists
# email = "^([email protected]|[email protected])$"
# optional custom types check regex
# types = "^(feat|fix|build|chore|ci|docs|perf|refactor|revert|style|test)$"
# optional header check regex
# header = "^(?P<type>\w+)(\((?P<scope>[\w/.-]+)\))?(?P<breaking>!)?:( +)?(?P<header>.+)"