mirror of https://github.com/astral-sh/ruff
Improve `T20X` ranges (#1502)
This commit is contained in:
parent
926b5494ad
commit
4e9e58bdc0
|
|
@ -1708,7 +1708,7 @@ where
|
|||
if self.settings.enabled.contains(&CheckCode::T201)
|
||||
|| self.settings.enabled.contains(&CheckCode::T203)
|
||||
{
|
||||
flake8_print::plugins::print_call(self, expr, func, keywords);
|
||||
flake8_print::plugins::print_call(self, func, keywords);
|
||||
}
|
||||
|
||||
// flake8-bugbear
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use crate::checkers::ast::Checker;
|
|||
use crate::checks::{Check, CheckKind};
|
||||
|
||||
/// T201, T203
|
||||
pub fn print_call(checker: &mut Checker, expr: &Expr, func: &Expr, keywords: &[Keyword]) {
|
||||
pub fn print_call(checker: &mut Checker, func: &Expr, keywords: &[Keyword]) {
|
||||
let mut check = {
|
||||
let call_path = dealias_call_path(collect_call_paths(func), &checker.import_aliases);
|
||||
if match_call_path(&call_path, "", "print", &checker.from_imports) {
|
||||
|
|
@ -27,9 +27,9 @@ pub fn print_call(checker: &mut Checker, expr: &Expr, func: &Expr, keywords: &[K
|
|||
}
|
||||
}
|
||||
}
|
||||
Check::new(CheckKind::PrintFound, Range::from_located(expr))
|
||||
Check::new(CheckKind::PrintFound, Range::from_located(func))
|
||||
} else if match_call_path(&call_path, "pprint", "pprint", &checker.from_imports) {
|
||||
Check::new(CheckKind::PPrintFound, Range::from_located(expr))
|
||||
Check::new(CheckKind::PPrintFound, Range::from_located(func))
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ expression: checks
|
|||
column: 0
|
||||
end_location:
|
||||
row: 4
|
||||
column: 22
|
||||
column: 5
|
||||
fix:
|
||||
content: ""
|
||||
location:
|
||||
|
|
@ -24,7 +24,7 @@ expression: checks
|
|||
column: 0
|
||||
end_location:
|
||||
row: 5
|
||||
column: 33
|
||||
column: 5
|
||||
fix:
|
||||
content: ""
|
||||
location:
|
||||
|
|
@ -40,7 +40,7 @@ expression: checks
|
|||
column: 0
|
||||
end_location:
|
||||
row: 6
|
||||
column: 39
|
||||
column: 5
|
||||
fix:
|
||||
content: ""
|
||||
location:
|
||||
|
|
@ -56,7 +56,7 @@ expression: checks
|
|||
column: 0
|
||||
end_location:
|
||||
row: 7
|
||||
column: 39
|
||||
column: 5
|
||||
fix:
|
||||
content: ""
|
||||
location:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ expression: checks
|
|||
column: 0
|
||||
end_location:
|
||||
row: 3
|
||||
column: 23
|
||||
column: 6
|
||||
fix:
|
||||
content: ""
|
||||
location:
|
||||
|
|
@ -24,7 +24,7 @@ expression: checks
|
|||
column: 0
|
||||
end_location:
|
||||
row: 7
|
||||
column: 30
|
||||
column: 13
|
||||
fix:
|
||||
content: ""
|
||||
location:
|
||||
|
|
|
|||
Loading…
Reference in New Issue