Skip to content

[Infinite loop] I002 and UP010 #18729

@dscorbett

Description

@dscorbett

Summary

Ruff fails to converge when missing-required-import (I002) and unnecessary-future-import (UP010) are selected and an unnecessary import is required.

$ echo 1 | ruff --isolated check - --select I002,UP010 --config 'lint.isort.required-imports=["from __future__ import generator_stop"]' --fix

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 I002, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

1
-:1:1: I002 Missing required import: `from __future__ import generator_stop`
Found 101 errors (100 fixed, 1 remaining).
[*] 1 fixable with the `--fix` option.

Version

ruff 0.12.0 (87f0feb 2025-06-17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions