Skip to content

Commit

Permalink
Avoid E275 if keyword is followed by a semicolon (#12095)
Browse files Browse the repository at this point in the history
fixes: #12094
  • Loading branch information
dhruvmanila authored Jun 28, 2024
1 parent c326778 commit 47b2273
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/pycodestyle/E27.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ def f():
match(foo):
case(1):
pass

# https://github.com/astral-sh/ruff/issues/12094
pass;
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub(crate) fn missing_whitespace_after_keyword(
|| matches!(
tok1_kind,
TokenKind::Colon
| TokenKind::Semi
| TokenKind::Newline
| TokenKind::NonLogicalNewline
// In the event of a syntax error, do not attempt to add a whitespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ E27.py:77:1: E275 [*] Missing whitespace after keyword
77 |+match (foo):
78 78 | case(1):
79 79 | pass
80 80 |

E27.py:78:5: E275 [*] Missing whitespace after keyword
|
Expand All @@ -142,3 +143,5 @@ E27.py:78:5: E275 [*] Missing whitespace after keyword
78 |- case(1):
78 |+ case (1):
79 79 | pass
80 80 |
81 81 | # https://github.com/astral-sh/ruff/issues/12094

0 comments on commit 47b2273

Please sign in to comment.