Skip to content

WPS115 alerts on IntEnum and StrEnum #3386

@snakeego

Description

@snakeego

What's wrong

https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/violations/naming.html#wemake_python_styleguide.violations.naming.UpperCaseAttributeViolation

The documentation says that an exception is made for Enum, but for subclasses (IntEnum, StrEnum) linter rise an error using UPPER_SNAKE_CASE

How it should be

Attributes in Enum subclasses allow to be in UPPER_SNAKE_CASE

Flake8 version and plugins

{
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.13.1",
    "system": "Linux"
  },
  "plugins": [
    {
      "plugin": "Flake8-pyproject",
      "version": "1.2.3"
    },
    {
      "plugin": "mccabe",
      "version": "0.7.0"
    },
    {
      "plugin": "pycodestyle",
      "version": "2.13.0"
    },
    {
      "plugin": "pyflakes",
      "version": "3.3.2"
    },
    {
      "plugin": "wemake-python-styleguide",
      "version": "1.1.0"
    }
  ],
  "version": "7.2.0"
}

pip information

attrs==25.3.0
flake8==7.2.0
flake8-pyproject==1.2.3
itpc-linters==7.0.0
mccabe==0.7.0
mypy==1.15.0
mypy-extensions==1.0.0
pycodestyle==2.13.0
pyflakes==3.3.2
pygments==2.19.1
ruff==0.11.4
types-python-dateutil==2.9.0.20241206
typing-extensions==4.13.1
vulture==2.14
wemake-python-styleguide==1.1.0

OS information

Ubuntu 24.04.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions