astral-sh / astral-sh/ruff

Fixing 101 unused variables shows error "Failed to converge after 100 iterations."

Open
#6,754 1 comment 1 reaction 0 assignees View on GitHub
needs-decision
Dominant language
Rust
Stars
49.7k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
458

Description

Ruff 0.0.285

```
ruff *.py --select ALL --no-cache
```

file content:
```
def f():
x0 = 1
x1 = 1
x2 = 1
x3 = 1
x4 = 1
x5 = 1
x6 = 1
x7 = 1
x8 = 1
x9 = 1
x10 = 1
x11 = 1
x12 = 1
x13 = 1
x14 = 1
x15 = 1
x16 = 1
x17 = 1
x18 = 1
x19 = 1
x20 = 1
x21 = 1
x22 = 1
x23 = 1
x24 = 1
x25 = 1
x26 = 1
x27 = 1
x28 = 1
x29 = 1
x30 = 1
x31 = 1
x32 = 1
x33 = 1
x34 = 1
x35 = 1
x36 = 1
x37 = 1
x38 = 1
x39 = 1
x40 = 1
x41 = 1
x42 = 1
x43 = 1
x44 = 1
x45 = 1
x46 = 1
x47 = 1
x48 =1
x49 = 1
x50 = 1
x51 = 1
x52 = 1
x53 = 1
x54 = 1
x55 = 1
x56 = 1
x57 = 1
x58 = 1
x59 = 1
x60 = 1
x61 = 1
x62 = 1
x63 = 1
x64 = 1
x65 = 1
x66 = 1
x67 = 1
x68 = 1
x69 = 1
x70 = 1
x71 = 1
x72 = 1
x73 = 1
x74 = 1
x75 = 1
x76 = 1
x77 = 1
x78 = 1
x79 = 1
x80 = 1
x81 = 1
x82 = 1
x83 = 1
x84 = 1
x85 = 1
x86 = 1
x87 = 1
x88 = 1
x89 = 1
x90 = 1
x91 = 1
x92 = 1
x93 = 1
x94 = 1
x95 = 1
x96 = 1
x97 = 1
x98 = 1
x99 = 1
x100 = 1
```

error:
```
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 `PY_FILE_TEST_1909706726.py`, the rule codes ANN201, D100, D103, F841, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

```

[PY_FILE_TEST_1909706726.py.zip](https://github.com/astral-sh/ruff/files/12405975/PY_FILE_TEST_1909706726.py.zip)

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the attached PY_FILE_TEST_1909706726.py and the command `ruff *.py --select ALL --no-cache`, using rules ANN201, D100, D103, and F841. Inspect the convergence handling involved in these diagnostics; done means the command completes without the 100-iteration error while still reporting the expected lint findings.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.