mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +00:00
DRY up usages of matches with fixer Mode (#470)
This commit is contained in:
parent
e7472eac1c
commit
f63a87737a
15 changed files with 53 additions and 57 deletions
|
@ -1,6 +1,5 @@
|
|||
use rustpython_ast::{Expr, Keyword, Stmt};
|
||||
|
||||
use crate::autofix::fixer;
|
||||
use crate::check_ast::Checker;
|
||||
use crate::pyupgrade;
|
||||
use crate::pyupgrade::checks;
|
||||
|
@ -14,7 +13,7 @@ pub fn useless_object_inheritance(
|
|||
) {
|
||||
let scope = checker.current_scope();
|
||||
if let Some(mut check) = checks::useless_object_inheritance(name, bases, scope) {
|
||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||
if checker.autofix.enabled() {
|
||||
if let Some(fix) = pyupgrade::fixes::remove_class_def_base(
|
||||
&mut checker.locator,
|
||||
&stmt.location,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue