Repository navigation
Conversation
amyreese
approved these changes
Jan 8, 2026
|
Contributor
|
Looks like this needs a rebase to clean up ecosystem results. |
Jkhall81
force-pushed
the
bugfix/22221-f401-infinite-loop
branch
from
January 8, 2026 19:30
cb22d52 to
e57982a
Compare
Collaborator
|
I don't think this is quite the fix we're after, sorry - here you've just skipped the whole rule in the case where a reference is found in Instead, we want to change the variant of the lint that we report so that we don't suggest adding anything to |
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.
Summary
This PR resolves a convergence failure (infinite loop) in rule
F401occurring in__init__.pyfiles.The fix is two-fold:
unused_import.rsto recognize that a parent package listed in__all__correctly re-exports its submodule imports (e.g.,["foo"]now coversimport foo.bar).add_to_dunder_allinedits.rsto check for existing entries before inserting new ones. This prevents duplicate strings from being appended and ensures the fixer terminates even if the linter re-flags an entry.Fixes #22221
Test Plan
crates/ruff_linter/src/fix/edits.rscovering duplicate detection in both lists and tuples.pyflakessnapshots to reflect the improved submodule matching logic.ruff check --fix --preview.cargo test -p ruff_linter) with 2625 tests passing.