-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
91 lines (76 loc) · 2.19 KB
/
hk.pkl
File metadata and controls
91 lines (76 loc) · 2.19 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
85
86
87
88
89
90
91
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"
local linters = new Mapping<String, Step> {
// Haskell:
["cabal-gild"] = new Step {
glob = List("**/*.cabal")
check = "cabal-gild -m check --input={{files}}"
fix = "cabal-gild -m format --io={{files}}"
}
["fourmolu"] = new Step {
glob = List("**/*.hs")
check = "fourmolu --mode check {{files}}"
fix = "fourmolu --mode inplace {{files}}"
}
["hlint"] = new Step {
glob = List("**/*.hs")
check = "hlint -XQuasiQuotes {{files}}"
fix = "hlint -XQuasiQuotes --refactor {{files}}"
}
// Markdown:
["mdformat"] = new Step {
glob = List("**/*.md")
check = "mdformat --check {{files}}"
fix = "mdformat {{files}}"
}
// 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")
workspace_indicator = "flake.nix"
check = "statix check {{workspace}}"
fix = "statix fix {{workspace}}"
batch = true
}
["write-files"] = new Step {
fix = "nix run .#write-files"
}
// 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) {
depends = List("write-files")
}
["trailing_whitespace"] = (Builtins.trailing_whitespace) {
depends = List("write-files")
}
}
hooks {
["pre-commit"] {
fix = true
stash = "git"
steps = linters
}
["pre-push"] {
steps = linters
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}