Adjust U011 start location (#828)

This commit is contained in:
Jonathan Plasse
2022-11-20 16:13:29 +01:00
committed by GitHub
parent 4be09b45ea
commit e63ea704f0
5 changed files with 20 additions and 58 deletions

View File

@@ -1,7 +1,8 @@
use rustpython_parser::ast::Expr;
use crate::autofix::Fix;
use crate::check_ast::Checker;
use crate::pyupgrade::{checks, fixes};
use crate::pyupgrade::checks;
/// U011
pub fn unnecessary_lru_cache_params(checker: &mut Checker, decorator_list: &[Expr]) {
@@ -12,11 +13,7 @@ pub fn unnecessary_lru_cache_params(checker: &mut Checker, decorator_list: &[Exp
&checker.import_aliases,
) {
if checker.patch(check.kind.code()) {
if let Some(fix) =
fixes::remove_unnecessary_lru_cache_params(checker.locator, &check.location)
{
check.amend(fix);
}
check.amend(Fix::deletion(check.location, check.end_location));
}
checker.add_check(check);
}