mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 22:55:08 +00:00
[pylint
] Add fix for duplicate-bases
(PLE0241
) (#12105)
## Summary This adds a fix for the `duplicate-bases` rule that removes the duplicate base from the class definition. ## Test Plan `cargo nextest run duplicate_bases`, `cargo insta review`.
This commit is contained in:
parent
da78de0439
commit
d1079680bb
4 changed files with 225 additions and 14 deletions
|
@ -202,11 +202,11 @@ pub(crate) enum Parentheses {
|
|||
}
|
||||
|
||||
/// Generic function to remove arguments or keyword arguments in function
|
||||
/// calls and class definitions. (For classes `args` should be considered
|
||||
/// `bases`)
|
||||
/// calls and class definitions. (For classes, `args` should be considered
|
||||
/// `bases`.)
|
||||
///
|
||||
/// Supports the removal of parentheses when this is the only (kw)arg left.
|
||||
/// For this behavior, set `remove_parentheses` to `true`.
|
||||
/// For this behavior, set `parentheses` to `Parentheses::Remove`.
|
||||
pub(crate) fn remove_argument<T: Ranged>(
|
||||
argument: &T,
|
||||
arguments: &Arguments,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue