forked from jdx/hk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
84 lines (80 loc) · 2.02 KB
/
Copy pathhk.pkl
File metadata and controls
84 lines (80 loc) · 2.02 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
78
79
80
81
82
83
84
// amends "package://github.com/jdx/hk/releases/download/v1.32.0/hk@1.32.0#/Config.pkl"
amends "pkl/Config.pkl"
import "pkl/Builtins.pkl"
// defines what happens during git pre-commit hook
local linters = new Mapping<String, Step | Group> {
["actionlint"] = Builtins.actionlint
["cargo-fmt"] = Builtins.cargo_fmt
// TODO: fails on releases with hk-example.pkl
// ["pkl"] {
// glob = new { "*.pkl" }
// check = "pkl eval {{files}} >/dev/null"
// }
// predefined formatters+linters
["cargo-clippy"] = (Builtins.cargo_clippy) {
profiles = List("slow")
check = "cargo clippy --manifest-path {{workspace_indicator}} --quiet -- -D warnings"
}
["cargo-check"] = (Builtins.cargo_check) {
profiles = List("!slow")
}
["dbg"] = new Step {
// ensure no dbg! macros are used
glob = "**/*.rs"
check = "! rg -e 'dbg!' {{files}}"
}
["eslint"] = (Builtins.eslint) {
dir = "docs"
prefix = "bun run"
}
["newlines"] = Builtins.newlines
["trailing-whitespace"] = Builtins.trailing_whitespace
["prettier"] = (Builtins.prettier) {
glob = List("*.js", "*.ts", "*.yml", "*.yaml") // override the default globs
}
["pkl-format"] = Builtins.pkl_format
["taplo"] = (Builtins.taplo) {
glob = "settings.toml"
}
["taplo-format"] = Builtins.taplo_format
["docs"] = new Step {
glob = "docs/**"
check = "mise run docs:build"
output_summary = "hide"
}
}
hooks = new {
["pre-commit"] {
fix = true
stash = "git"
steps = new {
["prelint"] {
check = "mise run prelint"
exclusive = true
}
...linters
["postlint"] {
check = "echo postlint"
exclusive = true
}
}
}
["pre-push"] {
steps = linters
}
["check"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
//["prepare-commit-msg"] {
// ["render-commit-msg"] {
// check = "echo 'default commit message' > {{commit_msg_file}}"
// }
//}
// TODO
// ["commit-msg"] {}
}
warnings = List("missing-profiles")