forked from jdx/mise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhk.pkl
More file actions
52 lines (49 loc) · 1.55 KB
/
hk.pkl
File metadata and controls
52 lines (49 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
amends "package://github.com/jdx/hk/releases/download/v1.0.0/hk@1.0.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.0.0/hk@1.0.0#/Builtins.pkl"
local bash_glob = List("*.sh", "xtasks/**", "scripts/**", "e2e/**")
local bash_exclude = List("*.ps1", "**/*.fish", "*.ts", "*.js", "*.json", "*.bat", "**/.*", "src/assets/bash_zsh_support/**", "e2e/shell/xonsh_script")
local linters = new Mapping<String, Step> {
// uses builtin prettier linter config
["prettier"] = (Builtins.prettier) {
batch = false
}
//["clippy"] = (Builtins.cargo_clippy) {
// check = "cargo clippy --manifest-path {{workspace_indicator}} --all-features -- -Dwarnings"
// fix = "cargo clippy --manifest-path {{workspace_indicator}} --all-features --fix --allow-dirty --allow-staged -- -Dwarnings"
//}
["cargo-check"] = (Builtins.cargo_check) {
check = "cargo check --all-features"
}
["shellcheck"] = (Builtins.shellcheck) {
glob = bash_glob
exclude = bash_exclude
batch = true
check = "shellcheck -x {{ files }}"
}
["shfmt"] = (Builtins.shfmt) {
check_list_files = """
files=$(shfmt -l -s {{ files }})
if [ -n "$files" ]; then
echo "$files"
exit 1
fi
"""
fix = "shfmt -w -s {{ files }}"
glob = bash_glob
exclude = bash_exclude
}
// uses custom pkl linter config
["pkl"] {
glob = "*.pkl"
check = "pkl eval {{files}} >/dev/null"
}
}
hooks {
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}