diff --git a/crates/ruff_linter/resources/test/fixtures/pycodestyle/E22.py b/crates/ruff_linter/resources/test/fixtures/pycodestyle/E22.py index 556984df20b45..d20bf4278111b 100644 --- a/crates/ruff_linter/resources/test/fixtures/pycodestyle/E22.py +++ b/crates/ruff_linter/resources/test/fixtures/pycodestyle/E22.py @@ -180,3 +180,6 @@ def squares(n): if i == -1: pass #: + +if a == 1: + print(a) diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs index 0fc9d93ef3a44..a707d2fb4b22b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs @@ -302,6 +302,7 @@ const fn is_operator_token(token: TokenKind) -> bool { | TokenKind::Equal | TokenKind::Percent | TokenKind::NotEqual + | TokenKind::EqEqual | TokenKind::LessEqual | TokenKind::GreaterEqual | TokenKind::CircumFlex diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E221_E22.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E221_E22.py.snap index ec75229e10a6b..7df31ee2f5c3b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E221_E22.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E221_E22.py.snap @@ -168,4 +168,20 @@ E22.py:19:14: E221 [*] Multiple spaces before operator 21 21 | x = 1 22 22 | y = 2 +E22.py:184:5: E221 [*] Multiple spaces before operator + | +182 | #: +183 | +184 | if a == 1: + | ^^ E221 +185 | print(a) + | + = help: Replace with single space +ℹ Safe fix +181 181 | pass +182 182 | #: +183 183 | +184 |-if a == 1: + 184 |+if a == 1: +185 185 | print(a) diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E222_E22.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E222_E22.py.snap index 52ec6b7ed6831..71fad6ac8ac73 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E222_E22.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E222_E22.py.snap @@ -105,4 +105,20 @@ E22.py:36:7: E222 [*] Multiple spaces after operator 38 38 | #: 39 39 | +E22.py:184:9: E222 [*] Multiple spaces after operator + | +182 | #: +183 | +184 | if a == 1: + | ^^ E222 +185 | print(a) + | + = help: Replace with single space +ℹ Safe fix +181 181 | pass +182 182 | #: +183 183 | +184 |-if a == 1: + 184 |+if a == 1: +185 185 | print(a)