mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Use SemanticModel
in lieu of Checker
in more methods (#4568)
This commit is contained in:
parent
19c4b7bee6
commit
d70f899f71
29 changed files with 199 additions and 199 deletions
|
@ -16,7 +16,7 @@ use crate::model::SemanticModel;
|
|||
/// # This is detected to be a logger candidate
|
||||
/// bar.error()
|
||||
/// ```
|
||||
pub fn is_logger_candidate(model: &SemanticModel, func: &Expr) -> bool {
|
||||
pub fn is_logger_candidate(func: &Expr, model: &SemanticModel) -> bool {
|
||||
if let Expr::Attribute(ast::ExprAttribute { value, .. }) = func {
|
||||
let Some(call_path) = (if let Some(call_path) = model.resolve_call_path(value) {
|
||||
if call_path.first().map_or(false, |module| *module == "logging") || call_path.as_slice() == ["flask", "current_app", "logger"] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue