-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds an astroid update (probably a release too) before being mergableenum
Description
Bug description
That check doesn't seem to check if the parent class actually defines enumeration members. This happens only if the parent class is defined in a differen module. MWE:
bar.py
import Enum
class StringEnum(str, Enum):
def __repr__(self) -> str:
return f"<{self.__class__.__name__}.{self.name}>"
foo.py
from bar import StringEnum
class ChatType(StringEnum):
SENDER = "sender"
PRIVATE = "private"
Configuration
No response
Command used
`pylint foo.py`Pylint output
************* Module foo
foo.py:1:0: C0114: Missing module docstring (missing-module-docstring)
foo.py:1:0: C0104: Disallowed name "foo" (disallowed-name)
foo.py:4:0: E0244: Extending inherited Enum class "StringEnum" (invalid-enum-extension)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)Expected behavior
pylint either checks the parent class for enum members or does enable this warning by default
Pylint version
pylint 2.14.1
astroid 2.11.5
Python 3.8.5OS / Environment
Windows
Additional dependencies
No response
PabloAlexis611
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds an astroid update (probably a release too) before being mergableenum