mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 07:37:38 +00:00
Consider Flask app logger as logger candidate (#4253)
This commit is contained in:
parent
11e1380df4
commit
2c91412321
3 changed files with 38 additions and 1 deletions
|
@ -19,7 +19,7 @@ use crate::context::Context;
|
|||
pub fn is_logger_candidate(context: &Context, func: &Expr) -> bool {
|
||||
if let ExprKind::Attribute { value, .. } = &func.node {
|
||||
let Some(call_path) = (if let Some(call_path) = context.resolve_call_path(value) {
|
||||
if call_path.first().map_or(false, |module| *module == "logging") {
|
||||
if call_path.first().map_or(false, |module| *module == "logging") || call_path.as_slice() == ["flask", "current_app", "logger"] {
|
||||
Some(call_path)
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue