-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlefthook.common.toml
More file actions
66 lines (55 loc) · 2.16 KB
/
Copy pathlefthook.common.toml
File metadata and controls
66 lines (55 loc) · 2.16 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
[pre-commit]
parallel = true
skip = ["merge", "rebase"]
[pre-commit.commands.format-go]
glob = ["*.go"]
run = "gofmt -s -w {staged_files}"
stage_fixed = true
[pre-commit.commands.format-rust]
glob = ["*.rs"]
run = "cargo fmt --all"
stage_fixed = true
[pre-commit.commands.format-just]
glob = ["*.just", ".justfile"]
run = 'for f in {staged_files}; do just --justfile "$f" --fmt; done'
stage_fixed = true
[pre-commit.commands.format-mise]
glob = [".mise.toml", ".mise/config.toml"]
run = "mise fmt"
stage_fixed = true
[pre-commit.commands.format-json]
glob = ["*.json", "*.json5", "*.jsonc"]
run = "oxfmt {staged_files}"
stage_fixed = true
[pre-commit.commands.format-markdown]
glob = ["*.md", "*.markdown", "*.mdx"]
run = "oxfmt {staged_files}"
stage_fixed = true
[pre-commit.commands.format-yaml]
glob = ["*.yaml", "*.yml"]
run = "oxfmt {staged_files}"
stage_fixed = true
[pre-commit.commands.mise-lock]
glob = [".mise.toml", ".mise/config.toml"]
# The -p list pins which platforms locks are generated for. mise infers the
# set from an existing lockfile (including for newly added tools), so this
# only decides the bootstrap case where no lockfile exists yet — without it a
# fresh lock would pick up musl and windows entries nothing installs, and
# those arches are where upstreams most often miss assets or signatures.
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; }'
[pre-commit.commands.actionlint]
glob = [".github/workflows/*.yaml"]
run = '''
actionlint -shellcheck= \
-ignore 'unexpected key "(background|cancel|parallel|wait|wait-all)" for step' \
-ignore 'step must run script with "run" section or run action with "uses" section' \
-ignore 'specifying action "\$/.*" in invalid format because ref is missing' \
-ignore 'reusable workflow call "\$/.*" at "uses" is not following the format' \
{staged_files}
'''
[pre-commit.commands.shellcheck]
glob = ["*.sh"]
run = "shellcheck {staged_files}"
[pre-commit.commands.zizmor]
glob = [".github/workflows/*.yaml", ".github/actions/**/action.yaml", "actions/**/action.yaml"]
run = "zizmor --offline {staged_files}"