lllin000_PaperForge/.pre-commit-config.yaml
Research Assistant 3729381fd5 feat: add hardcoded-path audit gate with pre-commit hook
- New tests/audit/test_hardcoded_paths.py detects config-driven path
  literals hardcoded in Python source files
- Pre-commit hook runs the audit automatically before every commit
- Fixed three existing violations:
  paperforge/commands/sync.py    -> use paperforge_paths()
  paperforge/commands/dashboard.py -> use paperforge_paths()
  paperforge/worker/discussion.py  -> use paths.get('index')
2026-05-20 15:39:21 +08:00

20 lines
651 B
YAML

# Pre-commit hooks — run automatically before every `git commit`
# Install: pip install pre-commit && pre-commit install
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: audit-hardcoded-paths
name: audit hardcoded paths
description: Fail if any Python source uses a hardcoded config-driven path instead of the config system
entry: python -m pytest tests/audit/test_hardcoded_paths.py -x --no-header -q
language: system
pass_filenames: false
types: [python]