From c2c3949b1547f47714b29f356aa8f2386389775d Mon Sep 17 00:00:00 2001 From: Hoel Bagard Date: Sun, 10 Mar 2024 00:43:23 +0900 Subject: [PATCH] reformulate comment. --- .../rules/logical_lines/missing_whitespace_after_keyword.rs | 2 +- .../rules/logical_lines/missing_whitespace_around_operator.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs index 3d6cb9a4e87773..9c7b3df7811a2e 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs @@ -62,7 +62,7 @@ pub(crate) fn missing_whitespace_after_keyword( TokenKind::Colon | TokenKind::Newline | TokenKind::NonLogicalNewline - | TokenKind::Rpar // In case of a syntax error, do not attempt to fix it. + | TokenKind::Rpar // In case of a syntax error, do not attempt to add a whitespace. )) && tok0.end() == tok1.start() { diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs index e8676f946994e3..bcedfe3d7fa31c 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs @@ -159,8 +159,8 @@ pub(crate) fn missing_whitespace_around_operator( while let Some(token) = tokens.next() { let kind = token.kind(); - // There should not be a ")" directly after a token as it is a syntax error. However if that happens, - // allow it to prevent entering a loop where E225 adds a space only for E202 to remove it. + // There should not be a ")" directly after a token, as it is a syntax error. However if that happens, + // allow it in order to prevent entering a loop where E225 adds a space only for E202 to remove it. if kind.is_trivia() || tokens .peek()