Use SemanticModel in lieu of Checker in more methods (#4568)

This commit is contained in:
Charlie Marsh 2023-05-21 22:58:47 -04:00 committed by GitHub
parent 19c4b7bee6
commit d70f899f71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 199 additions and 199 deletions

View file

@ -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"] {