forked from mpfaffenberger/code_puppy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
40 lines (38 loc) · 1.11 KB
/
lefthook.yml
File metadata and controls
40 lines (38 loc) · 1.11 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
pre-commit:
parallel: true
commands:
isort:
glob: "*.py"
run: |
if command -v uv >/dev/null 2>&1 && uv run isort --version >/dev/null 2>&1; then
uv run isort --profile black {staged_files}
elif command -v isort >/dev/null 2>&1; then
isort --profile black {staged_files}
else
echo "isort not found; using ruff import sorter";
if command -v uv >/dev/null 2>&1; then
uv run ruff check --select I --fix {staged_files}
else
ruff check --select I --fix {staged_files}
fi
fi
stage_fixed: true
ruff-format:
glob: "*.py"
run: |
if command -v uv >/dev/null 2>&1; then
uv run ruff format {staged_files}
else
ruff format {staged_files}
fi
stage_fixed: true
ruff-lint:
glob: "*.py"
run: |
if command -v uv >/dev/null 2>&1; then
uv run ruff check --fix {staged_files}
else
ruff check --fix {staged_files}
fi
stage_fixed: true
# pre-push hook removed - tests run in CI only