Allow capitalized names for logger candidate heuristic match (#6356)

Closes https://github.com/astral-sh/ruff/issues/6353.
This commit is contained in:
Charlie Marsh 2023-08-04 19:25:34 -04:00 committed by GitHub
parent 78a370303b
commit d788957ec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View file

@ -49,7 +49,13 @@ pub fn is_logger_candidate(
// logger names.
if let Some(call_path) = collect_call_path(value) {
if let Some(tail) = call_path.last() {
if tail.starts_with("log") || tail.ends_with("logger") || tail.ends_with("logging") {
if tail.starts_with("log")
|| tail.ends_with("logger")
|| tail.ends_with("logging")
|| tail.starts_with("LOG")
|| tail.ends_with("LOGGER")
|| tail.ends_with("LOGGING")
{
return true;
}
}