Skip to content

Commit 26cecd7

Browse files
committed
πŸ§‘β€πŸ’» lefthook config fine-tuning
1 parent 204c20a commit 26cecd7

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

β€Žlefthook.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
# Refer for explanation to following link:
22
# https://lefthook.dev/configuration/
3-
#
3+
4+
templates:
5+
run: run --no-sync
46

57
pre-commit:
68
parallel: true
79
jobs:
8-
- name: ruff-fix
9-
glob: "*.py"
10-
run: uv run ruff check --fix {staged_files}
11-
- name: ruff-format
12-
glob: "*.py"
13-
run: uv run ruff format {staged_files}
10+
- name: ruff
11+
glob: "*.{py,pyi}"
12+
stage_fixed: true
13+
group:
14+
piped: true
15+
jobs:
16+
- name: check
17+
run: uv {run} ruff check --fix {staged_files}
18+
- name: format
19+
run: uv {run} ruff format {staged_files}
1420
- name: mypy
15-
glob: "*.py"
16-
run: uv run --group mypy mypy {staged_files}
21+
glob: "*.{py,pyi}"
22+
run: uv {run} mypy {staged_files}
23+
24+
post-checkout:
25+
jobs:
26+
- run: uv sync
27+
glob: uv.lock
28+
29+
post-merge:
30+
files: "git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD"
31+
jobs:
32+
- run: uv sync
33+
glob: uv.lock

0 commit comments

Comments
Β (0)