-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.lefthook.yaml
37 lines (35 loc) · 1.11 KB
/
.lefthook.yaml
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
pre-commit:
jobs:
- name: tools
group:
parallel: true
jobs:
- name: dprint
glob: "*.{json,jsonc,md,yaml}"
run: mise exec -- dprint fmt {staged_files}
- name: shell-tools
glob: vault-token-helper-secret-tool
group:
jobs:
- name: shfmt
run: mise exec -- shfmt --write --simplify {staged_files}
- name: shellcheck
run: mise exec -- shellcheck --format=gcc {staged_files}
- name: tool-made-changes
run: |-
if test -n "${CI-}"; then
git diff --exit-code {staged_files}
else
git diff --quiet {staged_files}
fi
rc=$?
test $rc -eq 0 || echo "error: found files modified by tools" >&2
exit $rc
commit-msg:
commands:
committed:
run: mise exec -- committed --config .config/committed.toml --fixup --wip --commit-file "{1}"
commit-msgs-on-pr-branch:
commands:
committed:
run: mise exec -- committed --config .config/committed.toml -vv --no-merge-commit HEAD~..HEAD^2