Skip to content

Commit

Permalink
Revert "[Ruff 0.6] Stabilise PLR6104 (#12858)"
Browse files Browse the repository at this point in the history
This reverts commit cea8d57.
  • Loading branch information
AlexWaygood committed Aug 14, 2024
1 parent b845d58 commit cf18bed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/ruff_linter/src/codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
(Pylint, "R2004") => (RuleGroup::Stable, rules::pylint::rules::MagicValueComparison),
(Pylint, "R2044") => (RuleGroup::Stable, rules::pylint::rules::EmptyComment),
(Pylint, "R5501") => (RuleGroup::Stable, rules::pylint::rules::CollapsibleElseIf),
(Pylint, "R6104") => (RuleGroup::Stable, rules::pylint::rules::NonAugmentedAssignment),
(Pylint, "R6104") => (RuleGroup::Preview, rules::pylint::rules::NonAugmentedAssignment),
(Pylint, "R6201") => (RuleGroup::Preview, rules::pylint::rules::LiteralMembership),
(Pylint, "R6301") => (RuleGroup::Preview, rules::pylint::rules::NoSelfUse),
(Pylint, "W0108") => (RuleGroup::Preview, rules::pylint::rules::UnnecessaryLambda),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ use crate::checkers::ast::Checker;
/// statements.
///
/// ## Why is this bad?
/// 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`.
/// 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`.
///
/// When performing such an operation, an augmented assignment is more concise
/// When performing such an operation, augmented assignments are more concise
/// and idiomatic.
///
/// ## Known problems
Expand All @@ -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 trivially inferred, the rule
/// If the type of the left-hand side cannot be inferred trivially, the rule
/// will ignore the assignment.
///
/// ## Example
Expand Down

0 comments on commit cf18bed

Please sign in to comment.