You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rule E221 ([multiple-spaces-before-operator] and Rule E222 ([multiple-spaces-after-operator) work for normal assignment operators.
But If multiples spaces are present in if condition either before or after '==' operator Ruff does not catch.
#!/usr/bin/env python3
a = 1
if a == 1:
print(a)
In the above code Ruff flags the line a = 1 as error as it contains more space before and after operator where as it does not catch the error on the if condition.
/home/ashok/.local/bin/ruff check hello_world.py
hello_world.py:6:2: E221 [*] Multiple spaces before operator
|
5 | print('Hello World')
6 | a = 1
| ^^ E221
7 | if a == 1:
8 | print(a)
|
= help: Replace with single space
hello_world.py:6:5: E222 [*] Multiple spaces after operator
|
5 | print('Hello World')
6 | a = 1
| ^^ E222
7 | if a == 1:
8 | print(a)
|
= help: Replace with single space
Rule E221 ([multiple-spaces-before-operator] and Rule E222 ([multiple-spaces-after-operator) work for normal assignment operators.
But If multiples spaces are present in if condition either before or after '==' operator Ruff does not catch.
This issue is caught by flake8.
Ruff.toml
ruff version : 0.7.0
The text was updated successfully, but these errors were encountered: