-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
42 lines (38 loc) · 1.13 KB
/
hk.pkl
File metadata and controls
42 lines (38 loc) · 1.13 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
amends "package://github.com/jdx/hk/releases/download/v1.26.0/hk@1.26.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.26.0/hk@1.26.0#/Builtins.pkl"
local linters = new Mapping<String, Step> {
// eslint for TypeScript files
["eslint"] {
glob = "**/*.ts"
check = "eslint {{files}}"
fix = "eslint --fix {{files}}"
}
// uses builtin prettier linter config
["prettier"] = Builtins.prettier
// define a custom linter
["pkl"] {
glob = "*.pkl"
check = "pkl eval {{files}} >/dev/null"
}
}
hooks {
["pre-commit"] {
fix = true // automatically modify files with available linter fixes
stash = "git" // stashes unstaged changes while running fix steps
steps {
...linters // add all linters defined above
}
}
// instead of pre-commit, you can instead define pre-push hooks
["pre-push"] {
steps = linters
}
// "fix" and "check" are special steps for `hk fix` and `hk check` commands
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}