Skip to content

Infinite loop with invalid syntax #10295

@jc-louis

Description

@jc-louis

With this invalid syntax

a = (1 or)

I get with ruff v0.3.1

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 `test.py`, the rule codes E225, E275, E999, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

error: Failed to parse test.py:1:10: Unexpected token ')'
test.py:1:8: E225 Missing whitespace around operator
  |
1 | a = (1 or)
  |        ^^ E225
  |
  = help: Add missing whitespace

test.py:1:8: E275 Missing whitespace after keyword
  |
1 | a = (1 or)
  |        ^^ E275
  |
  = help: Added missing whitespace after keyword

test.py:1:10: E999 SyntaxError: Unexpected token ')'
  |
1 | a = (1 or)
  |          ^ E999
  |

Found 153 errors (150 fixed, 3 remaining).
[*] 2 fixable with the `--fix` option.

Not sure if it is really a bug given the invalid syntax, but the output could be nicer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violationshelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions