DRY up usages of matches with fixer Mode (#470)

This commit is contained in:
Charlie Marsh 2022-10-25 22:02:58 -04:00 committed by GitHub
parent e7472eac1c
commit f63a87737a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 53 additions and 57 deletions

View file

@ -1,7 +1,6 @@
use rustpython_ast::{Expr, Stmt};
use crate::ast::helpers;
use crate::autofix::fixer;
use crate::check_ast::Checker;
use crate::pyupgrade;
use crate::pyupgrade::checks;
@ -17,7 +16,7 @@ pub fn super_call_with_parameters(checker: &mut Checker, expr: &Expr, func: &Exp
.map(|index| checker.parents[*index])
.collect();
if let Some(mut check) = checks::super_args(scope, &parents, expr, func, args) {
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
if checker.autofix.enabled() {
if let Some(fix) =
pyupgrade::fixes::remove_super_arguments(&mut checker.locator, expr)
{