Skip to content
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

N815 does not enforce enums to be named IN_ALL_CAPS (pylint invalid-name) #15914

Closed
Apakottur opened this issue Feb 3, 2025 · 0 comments
Closed

Comments

@Apakottur
Copy link

Apakottur commented Feb 3, 2025

Description

Consider the following code:

# test.py
from enum import Enum, auto

class MyEnum(Enum):
    mango = auto()
    BANANA = auto()

Running

pylint test.py

Gives:

test.py:6:4: C0103: Class constant name "mango" doesn't conform to UPPER_CASE naming style (invalid-name)

According to the Pylint tracking issue, the invalid-name check is already implemented in Ruff under rule N815. However, running Ruff:

ruff check --select ALL test.py

Does not give any errors regarding the enum naming.

I'd expect Ruff to have a check that enforces enum members to be named in all caps, which is recommended in the official docs.

Details

ruff 0.9.4
pylint 3.3.4
astroid 3.3.8
Python 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0]

Pylint Issue about this check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants