mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Refactor range from Attributed
to Node
s (#4422)
This commit is contained in:
parent
140e0acf54
commit
fa26860296
330 changed files with 4816 additions and 3946 deletions
|
@ -1,4 +1,4 @@
|
|||
use rustpython_parser::ast::{self, Expr, ExprKind};
|
||||
use rustpython_parser::ast::{self, Expr};
|
||||
|
||||
use ruff_python_ast::call_path::collect_call_path;
|
||||
|
||||
|
@ -17,7 +17,7 @@ use crate::context::Context;
|
|||
/// bar.error()
|
||||
/// ```
|
||||
pub fn is_logger_candidate(context: &Context, func: &Expr) -> bool {
|
||||
if let ExprKind::Attribute(ast::ExprAttribute { value, .. }) = &func.node {
|
||||
if let Expr::Attribute(ast::ExprAttribute { value, .. }) = func {
|
||||
let Some(call_path) = (if let Some(call_path) = context.resolve_call_path(value) {
|
||||
if call_path.first().map_or(false, |module| *module == "logging") || call_path.as_slice() == ["flask", "current_app", "logger"] {
|
||||
Some(call_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue