FLL/.lefthook.yml

25 lines
712 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 --config pyproject.toml check --select E9,F63,F7,F82 --no-fix {staged_files}
# fix (pyupgrade, import sort, ecc.)
- name: 02_ruff_fix
glob: "*.py"
run: ruff --config pyproject.toml check --fix {staged_files}
stage_fixed: true
# formatter
- name: 03_ruff_format
glob: "*.py"
run: ruff --config pyproject.toml format {staged_files} || true
stage_fixed: true
# complete check
- name: 04_ruff_check_strict
glob: "*.py"
run: ruff --config pyproject.toml check {staged_files}