You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reject conflicting I002 + PYI025 configuration at startup
Fixes#20891.
When `lint.isort.required-imports` includes `from collections.abc import
Set` (unaliased) and PYI025 is enabled, the two rules conflict: I002
inserts the unaliased import, while PYI025 demands it be aliased as
`AbstractSet`. This causes an infinite autofix loop.
Rather than patching the import-insertion logic, reject this
contradictory configuration at startup in `Configuration::into_settings`,
following the existing pattern of `conflicting_import_settings()`. The
new `conflicting_required_import_pyi025()` function checks for the
specific conflict and emits a clear error message with a suggested fix.
Aliasing the required import as `AbstractSet` (satisfying both rules)
or disabling PYI025 are both accepted configurations.
0 commit comments