-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
77 lines (61 loc) · 1.82 KB
/
hk.pkl
File metadata and controls
77 lines (61 loc) · 1.82 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.19.0/hk@1.19.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.19.0/hk@1.19.0#/Builtins.pkl"
local rust_steps = new Mapping<String, Step> {
["cargo-check"] = (Builtins.cargo_check) {
check = "cargo check --workspace --all-targets"
fix = "cargo check --workspace --all-targets"
depends = "rustfmt"
check_first = true
}
["cargo-clippy"] = new Step {
glob = List("**/*.rs")
stage = List("**/*.rs")
check = "cargo clippy --workspace --all-targets -- -D warnings"
fix = "cargo clippy --workspace --all-targets --fix --allow-dirty --allow-staged -- -D warnings"
check_first = true
depends = "cargo-check"
}
["rustfmt"] = new Step {
glob = List("**/*.rs")
stage = List("**/*.rs")
check = "rustfmt --edition 2024 --check {{files}}"
fix = "rustfmt --edition 2024 {{files}}"
depends = "cargo-sort"
}
["cargo-sort"] = new Step {
glob = List("**/Cargo.toml")
stage = List("**/Cargo.toml")
check = "cargo sort --workspace --grouped --check ."
fix = "cargo sort --workspace --grouped ."
check_first = true
}
}
local project_steps = new Mapping<String, Step> {
...rust_steps
["shellcheck"] = Builtins.shellcheck
["actionlint"] = (Builtins.actionlint) {
dir = "."
}
["hadolint"] = Builtins.hadolint
["trailing-whitespace"] = Builtins.trailing_whitespace
["check-toml"] = (Builtins.taplo) {
glob = List("**/*.toml")
stage = List("**/*.toml")
}
["check-merge-conflict"] = Builtins.check_merge_conflict
["check-added-large-files"] = Builtins.check_added_large_files
}
hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = project_steps
}
["check"] {
steps = project_steps
}
["fix"] {
fix = true
steps = project_steps
}
}