-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Bug 🪲False Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the code
Milestone
Description
Almost certainly related to #4021 - most likely all class keywords arguments are not being checked.
Reproducer:
class Something( metaclass = ClassFactory ): pass
class ClassFactory( type ): passSteps to reproduce
- Run
pylint --score=no --reports=no --enable=all --disable=missing-module-docstring,missing-class-docstring,multiple-statements,too-few-public-methods,multiple-statementson the reproducer above. - Note the lack of complaint about using
ClassFactorybeing undefined. - Run the reproducer in a Python interpreter and note that it chokes on the undefined variable.
$ pylint --score=no --reports=no --enable=all --disable=missing-module-docstring,missing-class-docstring,multiple-statements,too-few-public-methods,multiple-statements pylint-bugs/metaclass_definition_order.py
$ echo $?
0
$ python3 pylint-bugs/metaclass_definition_order.py
Traceback (most recent call last):
File "pylint-bugs/metaclass_definition_order.py", line 1, in <module>
class Something( metaclass = ClassFactory ): pass
NameError: name 'ClassFactory' is not defined
Current behavior
No error from Pylint.
Expected behavior
An error about attempting to use an undefined variable in a class keyword.
pylint --version output
$ pylint --version
pylint 2.6.0
astroid 2.4.2
Python 3.6.12 (default, Nov 8 2020, 15:40:05)
[GCC 5.4.0 20160609]
Metadata
Metadata
Assignees
Labels
Bug 🪲False Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the code