mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 17:00:23 +00:00
- 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')
20 lines
651 B
YAML
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]
|