chore: ruff auto-fix PIE807 — reimplemented-container-builtin - #42035
Closed
wesleysimplicio wants to merge 1 commit into
Closed
wesleysimplicio wants to merge 1 commit into
wesleysimplicio wants to merge 1 commit into
Conversation
Collaborator
|
See consolidation note on #42036 — these four ruff PRs overlap and should be combined into one before merging. |
Contributor
Author
|
Closing in favor of consolidated PR (per austinpickett's request on #42036 — combining all four ruff PRs into one.) |
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 does this PR do?
Adds the
PIE807rule to pyproject.toml and applies auto-fix across 59 files.Replaces reimplemented container builtins with their literal equivalents — e.g.,
list(iterable),dict(iterable),set(iterable)→[*iterable], etc., where the intention is clearly to build a list/dict/set literal.Root cause
list(...),dict(...), andset(...)called with a non-keyword argument that is an iterable can often be expressed as a literal comprehension or starred expression, which is more idiomatic and avoids the call overhead. Leaving them as-is is correct but inconsistent.Fix
PIE807to[tool.ruff.lint] selectinpyproject.toml.ruff check --select PIE807 --preview --fix .— 218 errors fixed across 59 files.Why this shape
Same per-rule pattern as the existing ruff PRs (#31825–#32027, #42034): one rule, one auto-fix, one commit. Keeps diffs focused and blame history clean.
Tests
ruff checkpasses with zero errors after the fix (rule is active in config).Related PRs / issues