mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 14:00:51 -05:00
## Summary This fixes the infinite loop reported in #12897, where an `unused-import` that is undefined at the scope of `__all__` is "fixed" by adding it to `__all__` repeatedly. These changes make it so that only imports in the global scope will be suggested to add to `__all__` and the unused local import is simply removed. ## Test Plan Added a CLI integration test that sets up the same module structure as the original report Closes #12897 --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>