chore: add ruff lint to steering docs and auto-lint hook
- Steering: emphasize running ruff before committing Python changes - Hook: auto-runs ruff check --fix on services/**/*.py when files are edited
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"enabled": true,
|
||||
"name": "Ruff Lint Check",
|
||||
"description": "Runs ruff check on edited Python service files to catch lint errors before they reach CI",
|
||||
"version": "1",
|
||||
"when": {
|
||||
"type": "fileEdited",
|
||||
"patterns": [
|
||||
"services/**/*.py"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"type": "runCommand",
|
||||
"command": ".venv/bin/ruff check --fix services/",
|
||||
"timeout": 15
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@
|
||||
- Run Python tests: `python -m pytest tests/ -x --tb=short -q`
|
||||
- Run frontend tests: `cd frontend && npx vitest --run`
|
||||
- Lint Python: `.venv/bin/ruff check services/`
|
||||
- **Always run `.venv/bin/ruff check services/` before committing Python changes** — CI will reject the push if ruff fails
|
||||
- Ruff auto-fix: `.venv/bin/ruff check --fix services/` (fixes import sorting and other auto-fixable issues)
|
||||
- Ruff is pinned to `ruff==0.15.10` in `requirements.txt` — CI uses the same version
|
||||
- Ruff config: `ruff.toml` with `known-first-party = ["services"]` for consistent import sorting
|
||||
- Pre-existing test failures (not regressions): `test_extractor_prompts.py`, `test_extractor_schemas.py`, `test_filings_adapter.py`, `test_ollama_client.py`
|
||||
|
||||
Reference in New Issue
Block a user