Repository navigation
Expand file tree
/
Copy pathhk.pkl
More file actions
65 lines (59 loc) · 1.92 KB
/
Copy pathhk.pkl
File metadata and controls
65 lines (59 loc) · 1.92 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
amends "package://github.com/jdx/hk/releases/download/v1.50.0/hk@1.50.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.50.0/hk@1.50.0#/Builtins.pkl"
exclude =
List(
".kamal/hooks/*.sample",
"vendor/**/*",
"node_modules/**/*",
"tmp/**/*",
"app/components/shadcn/**/*",
)
local linters = new Mapping<String, Step> {
// Add linters here. Examples:
["prettier"] = (Builtins.prettier) {
check = "bin/prettier --check {{ files }}"
check_list_files = "bin/prettier --list-different {{ files }}"
fix = "bin/prettier --write {{ files }}"
}
["eslint"] = (Builtins.eslint) {
check = "bin/eslint {{ files }}"
fix = "bin/eslint --fix {{ files }}"
}
["tsc"] = (Builtins.tsc) {
check = "bin/tsc --noEmit -p {{ workspace_indicator }}"
}
["rubocop"] = (Builtins.rubocop) {
exclude = List("bin/*")
check = "bin/rubocop --force-exclusion {{ files }}"
check_list_files = "bin/rubocop --force-exclusion --list-target-files {{ files }}"
fix = "bin/rubocop --force-exclusion --autocorrect {{ files }}"
}
["sorbet"] = (Builtins.sorbet) {
exclude = List("sorbet/tapioca/compilers/**/*.rb", "bin/*", "ruby_lsp/**/*.rb")
// NOTE: Sorbet is a whole-program typechecker and reads its input paths from
// sorbet/config (--dir=.). Passing {{ files }} here would make Sorbet load
// each changed file twice (once via --dir=., once via the explicit arg),
// producing spurious "Duplicate type member" errors. So we check the whole
// project and let `glob` decide when the step runs.
check = "bin/srb tc --no-error-count"
fix = "bin/srb tc --no-error-count --autocorrect"
}
// Or define custom steps:
// ["custom"] {
// glob = "**/*.py"
// check = "mypy {{ files }}"
// }
}
hooks {
["pre-commit"] {
stash = "git"
steps = linters
}
["fix"] {
fix = true
steps = linters
}
["check"] {
steps = linters
}
}