-
-
Notifications
You must be signed in to change notification settings - Fork 962
Expand file tree
/
Copy pathhk.pkl
More file actions
91 lines (86 loc) · 3.15 KB
/
hk.pkl
File metadata and controls
91 lines (86 loc) · 3.15 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.1/hk@1.18.1#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.18.1/hk@1.18.1#/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", "**/*.py", "**/*.xsh")
local linters = new Mapping<String, Step> {
// uses builtin prettier linter config
["prettier"] = (Builtins.prettier) {
batch = false
exclude = "crates/aqua-registry/aqua-registry/**"
}
//["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-fmt"] {
glob = List("**/*.rs")
check = "cargo fmt --all -- --check"
fix = "cargo fmt --all"
}
["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"
}
// uses taplo for TOML formatting and validation
["taplo"] {
glob = List("**/*.toml")
exclude = List("docs/registry/") // exclude docs/registry/ symlink
check = "taplo fmt --check {{files}} && taplo check {{files}}"
fix = "taplo fmt {{files}} && taplo check {{files}}"
}
// uses lua-language-server to check vfox test plugin Lua files
// excludes embedded-plugins/ which are vendored from external repos
["lua-check"] {
glob = List("crates/vfox/plugins/**/*.lua")
check = "lua-language-server --check crates/vfox/plugins/"
}
["stylua"] {
glob = List("crates/vfox/plugins/**/*.lua")
check = "stylua --check crates/vfox/plugins/"
fix = "stylua crates/vfox/plugins/"
}
["actionlint"] {
glob = List(".github/workflows/*.yml")
check = "SHELLCHECK_OPTS='--exclude=SC1090 --exclude=SC2046 --exclude=SC2086 --exclude=SC2129' actionlint"
}
["markdownlint"] {
glob = List("**/*.md")
check = "markdownlint {{ files }}"
fix = "markdownlint --fix {{ files }}"
}
["schema"] {
glob = List("schema/**/*.json")
check = "ajv compile -s schema/mise.json --spec=draft2019 --strict-schema=true && ajv compile -s schema/mise-task.json --spec=draft2019 --strict-schema=true && ajv compile -s schema/mise.plugin.json --spec=draft2020 --strict-schema=true"
}
}
hooks {
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}