Repository navigation
Expand file tree
/
Copy pathhk.pkl
More file actions
61 lines (58 loc) · 1.95 KB
/
Copy pathhk.pkl
File metadata and controls
61 lines (58 loc) · 1.95 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
// Хуки ставит `hk install`: на git 2.54+ это записи hook.* в .git/config,
// общий core.hooksPath дерева кита они не трогают.
amends "package://github.com/jdx/hk/releases/download/v2.8.1/hk@2.8.1#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v2.8.1/hk@2.8.1#/Builtins.pkl"
// Быстрые проверки идут на каждый коммит. Сеть и долгие шаги вынесены в all:
// их гоняют check, pre-push и CI.
local fast = new Mapping<String, Step> {
["ruff-format"] {
glob = List("**/*.py")
check = "uv run ruff format --check {{files}}"
fix = "uv run ruff format {{files}}"
}
["ruff"] {
glob = List("**/*.py")
check = "uv run ruff check {{files}}"
fix = "uv run ruff check --fix {{files}}"
}
["rumdl"] = Builtins.rumdl
["typos"] = Builtins.typos
["jactionlint"] = Builtins.jactionlint
}
local all = (fast) {
["ty"] {
glob = List("**/*.py")
check = "uv run ty check"
}
["lychee"] {
glob = List("**/*.md")
check = "lychee --config lychee.toml --no-progress {{files}}"
}
}
hooks {
// stash выключен: на время хука он откатывает непроиндексированные файлы
// рабочего дерева, в том числе чужие правки параллельной сессии.
["pre-commit"] {
fix = true
stash = "none"
steps = fast
}
// История читается release-please, а коммиты идут прямо в main, поэтому
// заголовок проверяется до записи. В CI тот же commitlint гоняется по
// диапазону пуша.
["commit-msg"] {
steps {
["commitlint"] {
check = "commitlint --edit {{commit_msg_file}}"
}
}
}
["pre-push"] {
steps = all
}
["check"] { steps = all }
["fix"] {
fix = true
steps = all
}
}