-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
46 lines (42 loc) · 1.23 KB
/
Copy pathhk.pkl
File metadata and controls
46 lines (42 loc) · 1.23 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
amends "package://github.com/jdx/hk/releases/download/v1.54.1/hk@1.54.1#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.54.1/hk@1.54.1#/Builtins.pkl"
local linters = new Mapping<String, Step> {
["deno"] = Builtins.deno
["deno_check"] = Builtins.deno_check
["deno_lint"] {
glob = List("**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx")
stage = glob
check = "deno lint {{ files }}"
fix = "deno lint --fix {{ files }}"
}
["deno_test"] {
glob = List("**/*_test.ts")
check = "deno test --allow-read --allow-write {{ files }}"
}
["pkl"] {
glob = "*.pkl"
check = "pkl eval {{files}} >/dev/null"
}
}
hooks {
["pre-commit"] {
fix = true // automatically modify files with available linter fixes
stash = null
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
stash = null
steps = linters
}
["check"] {
steps = linters
}
}