Pre-commit and tests before commit/push
Rule
Before every commit or push, run:
- •Pre-commit (includes ruff, ruff-format, migration checks, and pytest):
bash
pre-commit run --all-files
- •If the project uses Poetry and pre-commit is not available in the current shell, run equivalent checks:
- •
make lintandmake format(orpoetry run ruff check . --fixandpoetry run ruff format .) - •
make test(orpoetry run pytest)
- •
Do not commit or push until pre-commit and tests pass. If hooks modify files (e.g. ruff --fix), stage those changes and run pre-commit again before committing.