mirror of https://github.com/astral-sh/ruff
Relax lowercase condition in N806 (#562)
This commit is contained in:
parent
b42d77a4c6
commit
4550581be2
|
|
@ -2,3 +2,4 @@ def f():
|
||||||
lower = 0
|
lower = 0
|
||||||
Camel = 0
|
Camel = 0
|
||||||
CONSTANT = 0
|
CONSTANT = 0
|
||||||
|
_ = 0
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ pub fn non_lowercase_variable_in_function(scope: &Scope, expr: &Expr, name: &str
|
||||||
if !matches!(scope.kind, ScopeKind::Function(FunctionScope { .. })) {
|
if !matches!(scope.kind, ScopeKind::Function(FunctionScope { .. })) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
if !is_lower(name) {
|
if name.to_lowercase() != name {
|
||||||
return Some(Check::new(
|
return Some(Check::new(
|
||||||
CheckKind::NonLowercaseVariableInFunction(name.to_string()),
|
CheckKind::NonLowercaseVariableInFunction(name.to_string()),
|
||||||
Range::from_located(expr),
|
Range::from_located(expr),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue