Repository navigation
Migrate code formatting from black + isort to ruff - #232
Merged
Merged
Conversation
bdraco
marked this pull request as ready for review
May 17, 2026 18:07
bdraco
enabled auto-merge (squash)
May 17, 2026 18:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What do these changes do?
Drop the standalone
blackandisortpre-commit hooks and use ruff for both formatting and import sorting. Adds a[tool.ruff.lint]block inpyproject.tomlselecting theIrule (withknown-first-party = ["propcache"]so the existingpytest/propcachetwo-section import layout is preserved) and replaces the two old hooks withruff-check(run with--fix --exit-non-zero-on-fix --show-fixesso import-sorting fixes apply on commit) andruff-format. The orphan[isort]block insetup.cfgis removed.ruff formatapplied four small reformats acrosstests/test_benchmarks.pyandtests/test_cached_property.py: stray blank lines after class headers were removed.ruff check --select Iproduced no diffs against the existing import order, so the isort half of the swap is a no-op on imports.Are there changes in behavior for the user?
No, contributor tooling only.
Related issue number
N/A
Checklist
pre-commit run --all-filesandruff check/ruff format --checkagainst the reformatted tree)CONTRIBUTORS.txt: N/A (no such file in this repo)CHANGES/folder (CHANGES/232.contrib.rst)Drafted with Claude Code (Opus 4.7); reviewed by @bdraco.
Agent run details (optional, for reviewers)
Verified: