- pre-commit ruff/ruff-format files: ^backend/ -> ^(backend|tradein-mvp/backend)/; clean trade_in_pdf.py 51->0 (dead PIL/days_overlay/qr_url + 47 E501; render byte-identical). - deploy-tradein.yml: new pytest 'test' job gating build+deploy. - fix suite for green gate: tests/matching/__init__.py (collection error) + restore get_role in test_history_scope.py (teardown leak breaking test_rbac). - 1087 tests green; 2 pre-existing order-dependent tests deselected+documented. No runtime-logic changes. Closes #666
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
# Local pre-commit hooks. Install once with:
|
|
# pip install pre-commit
|
|
# pre-commit install
|
|
#
|
|
# After install: every `git commit` runs these checks against staged files.
|
|
# Failures abort the commit.
|
|
|
|
repos:
|
|
# Generic hygiene
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: check-yaml
|
|
exclude: ^backend/alembic/script.py.mako$
|
|
- id: check-toml
|
|
- id: check-added-large-files
|
|
args: ["--maxkb=512"]
|
|
- id: check-merge-conflict
|
|
- id: detect-private-key
|
|
|
|
# Python — ruff (lint + format) on backend/ + tradein-mvp/backend/
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.7.4
|
|
hooks:
|
|
- id: ruff
|
|
args: [--fix]
|
|
files: ^(backend|tradein-mvp/backend)/
|
|
- id: ruff-format
|
|
files: ^(backend|tradein-mvp/backend)/
|
|
|
|
# Frontend — prettier on TS/TSX/JSON
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
rev: v4.0.0-alpha.8
|
|
hooks:
|
|
- id: prettier
|
|
files: ^frontend/.*\.(ts|tsx|js|jsx|json|css|md)$
|
|
exclude: ^frontend/(node_modules|\.next|package-lock\.json)/
|