Relax lowercase condition in N806 (#562)

This commit is contained in:
Charlie Marsh 2022-11-02 22:38:29 -04:00 committed by GitHub
parent b42d77a4c6
commit 4550581be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -2,3 +2,4 @@ def f():
lower = 0
Camel = 0
CONSTANT = 0
_ = 0

View File

@ -118,7 +118,7 @@ pub fn non_lowercase_variable_in_function(scope: &Scope, expr: &Expr, name: &str
if !matches!(scope.kind, ScopeKind::Function(FunctionScope { .. })) {
return None;
}
if !is_lower(name) {
if name.to_lowercase() != name {
return Some(Check::new(
CheckKind::NonLowercaseVariableInFunction(name.to_string()),
Range::from_located(expr),