mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Implement reimplemented_operator
(FURB118) (#9171)
## Summary Implement [FURB118](https://github.com/dosisod/refurb/blob/master/docs/checks.md#furb118-use-operator) that recommends, for example, that `lambda x, y: x + y` is replaced with `operator.add`. Part of #1348. ## Test Plan Added test cases.
This commit is contained in:
parent
0977fa987b
commit
c532089fb3
9 changed files with 1033 additions and 1 deletions
|
@ -952,6 +952,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Refurb, "105") => (RuleGroup::Preview, rules::refurb::rules::PrintEmptyString),
|
||||
#[allow(deprecated)]
|
||||
(Refurb, "113") => (RuleGroup::Nursery, rules::refurb::rules::RepeatedAppend),
|
||||
(Refurb, "118") => (RuleGroup::Preview, rules::refurb::rules::ReimplementedOperator),
|
||||
#[allow(deprecated)]
|
||||
(Refurb, "131") => (RuleGroup::Nursery, rules::refurb::rules::DeleteFullSlice),
|
||||
#[allow(deprecated)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue