-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.lefthook.yaml
41 lines (39 loc) · 1.28 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
38
39
40
41
pre-commit:
jobs:
- name: mutating-tools
group:
parallel: true
jobs:
- name: dprint
glob: "*.{json,jsonc,md,toml,yaml}"
run: mise exec -- dprint fmt {staged_files}
- name: python-tools
glob: "*.py"
group:
jobs:
- name: ruff-check
run: mise exec -- ruff check --force-exclude --fix {staged_files}
- name: ruff-format
run: mise exec -- ruff format --force-exclude {staged_files}
- name: mypy
run: uv run mypy .
- name: typos
run: mise exec -- typos --force-exclude --write-changes {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