-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N816 doesn't flag lower-case variable names #14905
Comments
The current behavior makes sense to me, considering that the rule is about variable names in functions and doesn't enforce lower case variable names in general.
And |
If possible I think it would be nice to have an additional rule covering those cases, even if is another scope. |
There's https://docs.astral.sh/ruff/rules/mixed-case-variable-in-global-scope/ but it doesn't forbid using variable names that start with an uppercase character. I'm not sure why is but the rule matches the behavior of the upstream rule PyCQA/pep8-naming#69 |
That is odd, docs leave the impression that any non snake case variables will trigger the rule. |
I merge this with #15069 that lists a few reasons |
Context managers are not taken into consideration for variable naming conventions, despite PEP8 not making exceptions for them. The only way to trigger variable rules is to wrap them in other structures like a
def
.The text was updated successfully, but these errors were encountered: