-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhk.pkl
More file actions
77 lines (74 loc) · 2.43 KB
/
Copy pathhk.pkl
File metadata and controls
77 lines (74 loc) · 2.43 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
amends "package://github.com/jdx/hk/releases/download/v1.56.0/hk@1.56.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.56.0/hk@1.56.0#/Builtins.pkl"
import "package://github.com/hugoh/hk-config/releases/download/v1.4.1/hk-config@1.4.1#/base.pkl" as Base
min_hk_version = Base.min_hk_version
local linters = new Mapping<String, Step> {
...Base.base
...Base.shell
// go generate output can legitimately end without touching trailing
// whitespace elsewhere in the file; base's check conflicts with that
["trailing_whitespace"] = (Builtins.trailing_whitespace) {
condition = "false"
}
// hugoh/go-tools' own self-referential workflow pins are rendered by this
// template using the raw commit hash with no version comment; excluding
// them from pinact keeps that comment-less form stable so copier update's
// 3-way merge never has to reconcile a pinact-added comment against the
// template's un-commented rendering
["pinact"] = (Builtins.pinact) {
check_diff = "pinact run --verify --check --exclude 'hugoh/go-tools.*' {{ files }}"
fix = "pinact run --verify --exclude 'hugoh/go-tools.*' {{ files }}"
}
// .copier-answers.yml is written entirely by copier's own YAML
// serializer, not rendered from a template file — it sometimes appends a
// trailing blank line on `copier update`, which would otherwise fail this
// check on every automated template-update PR
["newlines"] = (Builtins.newlines) {
exclude = List(".copier-answers.yml")
}
// Same copier-serializer quirk as above: it omits the trailing newline
// ryl's new-line-at-end-of-file rule expects
["ryl"] = (Builtins.ryl) {
exclude = List(".copier-answers.yml")
}
["golangci_lint_config"] = {
check = "golangci-lint config verify"
}
["golangci_lint"] = (Builtins.golangci_lint) {
profiles = List("!ci")
}
["gomod_tidy"] = (Builtins.gomod_tidy) {
profiles = List("!ci")
}
["conventional_commit"] {
check = "cog check --from-latest-tag"
}
["govulncheck"] = {
check = "govulncheck ./..."
profiles = List("!ci")
}
["duplication"] = {
check = "cpd"
}
}
hooks {
["pre-commit"] {
stash = "git"
steps = linters
}
["pre-push"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
["commit-msg"] {
steps = new Mapping<String, Step> {
["cocogitto_commit_msg"] = Builtins.cocogitto_commit_msg
}
}
}