-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
C0103/N815: Constant names are not checked against UPPER_CASE naming convention #2964
Comments
I'm not sure how I want to proceed, but I found this old issue on I suppose I'd be okay with implementing C0103 as a separate rule. |
I will work on that if that's ok ! |
👋 Looking for a bit of guidance here, should I implement the full |
While there are already some N801, N802, etc. rules, it would indeed be ideal to implement the full functionality of this into it's own pylint category of rules. I'd prefer you just start with rules for the CONSTANT variable. Ex. for "SolidNumber" And ideally we could use both enforce-const-naming-style-UPPER and enforce-const-naming-style-snake-case: |
Hi ruff team,
It looks like ruff doesn't check the name of constants like pylint does, despite
invalid-name
/C0103
(N815
) being marked as done in the pylint tracking issue.PEP 8 recommends UPPER_CASE for constant names (ref).
Example
Solutions
pep8-naming N816 (mixedCase variable in global scope) already implements a weaker version of this, so I was able to adapt the code to only allow UPPER_CASE variable names in global scope, but the two rules feel a bit redundant together as some constant named
thisIs_incorrect
would trigger both N816 (because it is a mixed case naming) and C0103 (it does not follow UPPER_CASE convention for constants).I guess there are 2 paths forward to solve this issue:
pep8-naming
packageIn any case, I would be glad to submit a PR to help get this fixed !
PS: Thanks for the awesome work you're all doing !
The text was updated successfully, but these errors were encountered: