.lefthook.toml
1
[pre-commit]
2
parallel = false
3
skip = ["merge", "rebase"]
5
[pre-commit.commands.format-go]
6
glob = ["*.go"]
7
run = "gofmt -s -w {staged_files}"
8
stage_fixed = true
10
[pre-commit.commands.format-rust]
11
glob = ["*.rs"]
12
run = "cargo fmt --all"
13
stage_fixed = true
15
[pre-commit.commands.format-just]
16
glob = ["*.just", ".justfile"]
17
run = 'for f in {staged_files}; do just --justfile "$f" --fmt; done'
18
stage_fixed = true
20
[pre-commit.commands.format-mise]
21
glob = [".mise.toml", ".mise/config.toml"]
22
run = "mise fmt"
23
stage_fixed = true
25
[pre-commit.commands.format-json]
26
glob = ["*.json", "*.json5", "*.jsonc"]
27
run = "oxfmt {staged_files}"
28
stage_fixed = true
30
[pre-commit.commands.format-markdown]
31
glob = ["*.md", "*.markdown", "*.mdx"]
32
exclude = ["AGENTS.md", "CONTRIBUTING.md", ".github/copilot-instructions.md"]
33
run = "oxfmt {staged_files}"
34
stage_fixed = true
36
[pre-commit.commands.format-yaml]
37
glob = ["*.yaml", "*.yml"]
38
run = "oxfmt {staged_files}"
39
stage_fixed = true
41
[pre-commit.commands.mise-lock]
42
glob = [".mise.toml", ".mise/config.toml"]
43
run = 'mise lock -p linux-x64,linux-arm64,macos-arm64 && { for f in {staged_files}; do l="$(dirname "$f")/mise.lock"; [ -f "$l" ] && git add "$l"; done; true; }'
45
[pre-commit.commands.actionlint]
46
glob = [".github/workflows/*.yaml"]
47
run = '''
48
actionlint -shellcheck= \
49
-ignore 'unexpected key "(background|cancel|parallel|wait|wait-all)" for step' \
50
-ignore 'step must run script with "run" section or run action with "uses" section' \
51
-ignore 'specifying action "\$/.*" in invalid format because ref is missing' \
52
-ignore 'reusable workflow call "\$/.*" at "uses" is not following the format' \
53
{staged_files}
54
'''
56
[pre-commit.commands.shellcheck]
57
glob = ["*.sh"]
58
run = "shellcheck {staged_files}"
60
[pre-commit.commands.zizmor]
61
glob = [".github/workflows/*.yaml", ".github/actions/**/action.yaml", "actions/**/action.yaml"]
62
run = "zizmor --offline {staged_files}"
64
[pre-commit.commands.koment-check]
65
run = "koment check"
67
[pre-commit.commands.koment-agents-check]
68
run = "koment agents check"