Summary
The fix for lazy-import-mismatch (TID254) fails to converge when a single import statement lists one module required to be imported lazily and another module banned from being imported lazily. Example:
$ echo 'import this, typing' | ruff check --preview --target-version py315 --select TID254 - --config 'lint.flake8-tidy-imports = {ban-lazy = ["this"], require-lazy = ["typing"]}' --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 TID254, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!
Would fix 100 errors.
The fix should add a separate lazy import statement in that case.
Version
ruff 0.15.20 (f82a36b 2026-06-25)
Summary
The fix for
lazy-import-mismatch(TID254) fails to converge when a single import statement lists one module required to be imported lazily and another module banned from being imported lazily. Example:The fix should add a separate
lazy importstatement in that case.Version
ruff 0.15.20 (f82a36b 2026-06-25)