Files
pet-project-server/lefthook.yml
T
av bdc319df64 линтеры python перенастроены: mypy заменён на pyrefly
- набор правил ruff расширен по канону rp-local-env (ANN, PTH, C90, G и др.),
  в lefthook добавлен job ruff check --fix
- код приведён под новые правила: логирование через %s вместо f-строк,
  os.path заменён на pathlib, run_backup_process и initialize разбиты
  на функции по порогу цикломатической сложности
2026-08-22 11:32:03 +03:00

45 lines
1.1 KiB
YAML

# Refer for explanation to following link:
# https://lefthook.dev/configuration/
glob_matcher: doublestar
templates:
av-hooks-dir: "/home/av/projects/private/git-hooks"
pre-commit:
jobs:
- name: "format python"
glob: "**/*.py"
run: "uv run ruff format {staged_files}"
stage_fixed: true
- name: "fix python"
glob: "**/*.py"
run: "uv run ruff check --fix {staged_files}"
stage_fixed: true
- name: "check python"
glob: "**/*.py"
run: "uv run ruff check {staged_files}"
- name: "pyrefly"
glob: "**/*.py"
run: "uv run pyrefly check {staged_files}"
- name: "yamllint"
glob: "**/*.{yml,yaml}"
run: "uv run yamllint --config-file .yamllint.yml --format colored {staged_files}"
- name: "ansible-lint"
glob: "**/*.{yml,yaml}"
exclude:
- ".gitea/**"
run: "uv run ansible-lint --profile production --offline -- {staged_files}"
- name: "gitleaks"
run: "gitleaks git --staged"
- name: "check secret files"
run: "python3 {av-hooks-dir}/pre-commit/check-secrets-encrypted-with-ansible-vault.py"