From bebed67bf13cfbbf0c110690c81a81e0dfe3e07f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 14 Aug 2024 10:50:00 +0100 Subject: [PATCH] Improve docs for `non-augmented-assignment` (`PLR6104`) (#12887) --- .../rules/pylint/rules/non_augmented_assignment.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs b/crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs index fa73252872..a0b2ccf3bb 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs @@ -14,12 +14,12 @@ use crate::checkers::ast::Checker; /// statements. /// /// ## Why is this bad? -/// If an assignment statement consists of a binary operation in which one -/// operand is the same as the assignment target, it can be rewritten as an -/// augmented assignment. For example, `x = x + 1` can be rewritten as -/// `x += 1`. +/// If the right-hand side of an assignment statement consists of a binary +/// operation in which one operand is the same as the assignment target, +/// it can be rewritten as an augmented assignment. For example, `x = x + 1 +/// can be rewritten as `x += 1`. /// -/// When performing such an operation, augmented assignments are more concise +/// When performing such an operation, an augmented assignment is more concise /// and idiomatic. /// /// ## Known problems @@ -31,7 +31,7 @@ use crate::checkers::ast::Checker; /// For example, `x = "prefix-" + x` is not equivalent to `x += "prefix-"`, /// while `x = 1 + x` is equivalent to `x += 1`. /// -/// If the type of the left-hand side cannot be inferred trivially, the rule +/// If the type of the left-hand side cannot be trivially inferred, the rule /// will ignore the assignment. /// /// ## Example