chore(linting): replace black, isort and flake8 with ruff #281
+127
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Change Type
ruffand deprecatesautoflake,isort, andblack.💡 Description
Consolidate Python linting and formatting into Ruff - a single, fast tool that replaces autoflake, isort, Black, and flake8.
Why Ruff?
uv, enabling tighter toolchain integration in future PRsKey Changes
ruff.tomlwith unified linting/formatting configuration.pre-commit-config.yamlto use ruff hooks (v0.14.6) instead of autoflake/isort/blackblack,isortfrom dev dependencies; updateruff>=0.14.6[tool.black],[tool.isort],[tool.ruff]sections frompyproject.toml(now inruff.toml)Configuration Details
Preserved from existing config:
src/parallax/p2p/proto/(generated protobuf)New lint rules enabled:
E,W,FINUPBC4SIMRUFTIDASYNCDeferred rules (extend-ignore):
Some rules require larger refactoring and are deferred to follow-up PRs:
PTH(pathlib migration),TCH(TYPE_CHECKING imports),B006(mutable defaults)N802/803/806(naming - often intentional for math notation)ruff.tomlfor full list with rationale✅ Checklist
📋 Test Plan
pre-commit run --all-filespasses locally after rules are approved.github/workflows/pre-commit.ymlvalidates linting in CI