FLL/.lefthook.yml
2025-09-13 23:00:44 +02:00

25 lines
628 B
YAML

pre-commit:
parallel: false
piped: true # stop at the first fail
jobs:
# check for hard errors
- name: 01_ruff_syntax
glob: "*.py"
run: ruff check --select E9,F63,F7,F82 --no-fix {staged_files}
# fix (pyupgrade, import sort, ecc.)
- name: 02_ruff_fix
glob: "*.py"
run: ruff check --fix --exit-zero {staged_files}
stage_fixed: true
# formatter
- name: 03_ruff_format
glob: "*.py"
run: ruff format {staged_files} || true
stage_fixed: true
# complete check
- name: 04_ruff_check_strict
glob: "*.py"
run: ruff check {staged_files}