-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome
Description
Summary
The fix for readlines-in-for (FURB129) fails because of a syntax error when the file variable is parenthesized.
$ cat >furb129.py <<'# EOF'
with open("furb129.py") as f:
for line in (f).readlines():
pass
# EOF
$ ruff --isolated check furb129.py --select FURB129 --unsafe-fixes --diff
error: Fix introduced a syntax error. Reverting all changes.
This indicates a bug in Ruff. If you could open an issue at:
https://github.com/astral-sh/ruff/issues/new?title=%5BFix%20error%5D
...quoting the contents of `furb129.py`, the rule codes FURB129, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!
Version
ruff 0.11.10 (b35bf8a 2025-05-15)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome