-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
66 lines (59 loc) · 1.55 KB
/
hk.pkl
File metadata and controls
66 lines (59 loc) · 1.55 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
amends "package://github.com/jdx/hk/releases/download/v1.18.3/hk@1.18.3#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.18.3/hk@1.18.3#/Builtins.pkl"
// Define linters to use across hooks
local linters = new Mapping<String, Step> {
// Nix:
["alejandra"] = (Builtins.alejandra) {
check = "alejandra --check --quiet {{files}}"
fix = "alejandra --quiet {{files}}"
}
["deadnix"] = new Step {
glob = List("**/*.nix")
check = "deadnix --fail --no-lambda-pattern-names {{files}}"
fix = "deadnix --no-lambda-pattern-names --edit {{files}}"
batch = true
}
["statix"] = new Step {
glob = List("**/*.nix")
check = "statix check -- {{files}}"
fix = "statix fix -- {{files}}"
batch = true
}
// Infrastructure:
["actionlint"] = Builtins.actionlint
// Configuration files:
["pkl"] = Builtins.pkl
// Builtins:
["check_merge_conflict"] = Builtins.check_merge_conflict
["check_symlinks"] = Builtins.check_symlinks
["mixed_line_ending"] = Builtins.mixed_line_ending
["newlines"] = Builtins.newlines
["trailing_whitespace"] = Builtins.trailing_whitespace
}
hooks {
["pre-commit"] {
// Enable automatic fixes
fix = true
// Stash unstaged changes
stash = "git"
steps = linters
}
["pre-push"] {
// Just check, don't fix
steps = linters
}
["commit-msg"] {
steps {
["gitlint"] = new Step {
check = "gitlint --msg-filename {{commit_msg_file}}"
}
}
}
["check"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
}