ruff/crates/ruff_linter/resources/test/fixtures/pyflakes/F401_33
Brent Westbrook ca3b210f2e
[pyflakes] Fix infinite loop with unused local import in __init__.py (F401) (#15517)
## 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>
2025-01-16 10:43:32 -05:00
..
__init__.py [pyflakes] Fix infinite loop with unused local import in __init__.py (F401) (#15517) 2025-01-16 10:43:32 -05:00
other.py [pyflakes] Fix infinite loop with unused local import in __init__.py (F401) (#15517) 2025-01-16 10:43:32 -05:00