Repository metrics
- Stars
- (282 stars)
- PR merge metrics
- (PR metrics pending)
Description
The current pre-commit stack has three overlapping tools (black, isort, flake8) where one would do. Ruff covers all three, runs faster, and opens up rule categories we currently have no coverage for.
Replace black + isort + flake8 with ruff
Ruff is a drop-in replacement for all three. The [tool.black], [tool.isort], and [tool.flake8] sections in pyproject.toml go away and get replaced with a single [tool.ruff] block. The pre-commit hooks reduce from three entries to one.
Enable additional rule categories
With ruff in place it's easy to turn on rules we currently have no coverage for:
S- bandit security rules. Would have caught theshell=Truesubprocess bug fixed in v0.6.0PT- pytest anti-patterns, directly relevant given the ongoing test workPTH- preferpathliboveros.path, the codebase mixes bothUP- modernise Python syntax across supported versionsG- logging format, relevant since switching to loguruTCH- move type-only imports intoTYPE_CHECKINGblocks
These can be introduced with ignore entries for anything not ready to enforce immediately and tightened over time.
Add small pre-commit hooks
pyproject-fmt- keepspyproject.tomlconsistently formattedpython-check-blanket-noqa- requires a specific code on every# noqacommentno-commit-to-branch- prevents accidental direct commits tomain