Skip to content

[Infinite loop] F401, I002, and PYI025 #20891

@dscorbett

Description

@dscorbett

Summary

Ruff fails to converge when unused-import (F401), missing-required-import (I002), and unaliased-collections-abc-set-import (PYI025) are selected and from collections.abc import Set is a required import.

$ echo 1 | ruff --isolated check --select F401,I002,PYI025 --config 'lint.isort.required-imports = ["from collections.abc import Set"]' - --unsafe-fixes --diff

error: Failed to converge after 100 iterations.

This indicates a bug in Ruff. If you could open an issue at:

    https://github.com/astral-sh/ruff/issues/new?title=%5BInfinite%20loop%5D

...quoting the contents of `-`, the rule codes PYI025, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

@@ -1 +1,2 @@
+from collections.abc import Set
 1

Would fix 100 errors.

Version

ruff 0.14.0 (beea8cd 2025-10-07)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixesRelated to suggested fixes for violations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions