-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathhk.pkl
More file actions
53 lines (51 loc) · 1.33 KB
/
Copy pathhk.pkl
File metadata and controls
53 lines (51 loc) · 1.33 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
44
45
46
47
48
49
50
51
52
53
amends "package://github.com/jdx/hk/releases/download/v1.50.0/hk@1.50.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.50.0/hk@1.50.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
["golangci-lint"] = Builtins.golangci_lint
["gomod-tidy"] = Builtins.gomod_tidy
["typos"] = (Builtins.typos) {
fix = check
}
// ["lychee"] = Builtins.lychee
["nllint"] {
glob = List("**/*")
check = "nllint -s {{files}}"
fix = "nllint -s -f {{files}}"
batch = true
}
["go-test"] {
glob = List("go.mod", "go.sum", "**/*.go")
check = "go test -race -covermode=atomic ./..."
fix = "go test -race -covermode=atomic ./..." // run as check in fix mode (no real fix possible)
batch = true
}
["langcheck"] {
// https://github.com/suzuki-shunsuke/langcheck
glob = List("**/*")
check = "langcheck check {{files}}"
fix = "langcheck check {{files}}" // run as check in fix mode (no real fix possible)
batch = true
}
}
hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}
["commit-msg"] {
steps {
["langcheck"] {
// https://github.com/suzuki-shunsuke/langcheck
check = "langcheck check {{commit_msg_file}}"
}
}
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}