Type-hinted additional-builtins raise error since 2.12 #6388
Labels
Bug 🪲
C: undefined-variable
Issues related to 'undefined-variable' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
Milestone
Bug description
This example will warn about
__additional_builtin__
being anundefined-variable
since 2.12.0 despite__additional_builtin__
being listed in.pylintrc
.Without the type hints, no warning is issued.
I looked at the source code, and tested it locally, and the new warning is added here: https://github.com/PyCQA/pylint/blob/main/pylint/checkers/variables.py#L1683-L1685=
The
__additional_builtin__
variables is correctly identified as only previously assigned as a type hint, but the branch does not check forVARIABLES.additional-builtins
as, for example, here: https://github.com/PyCQA/pylint/blob/main/pylint/checkers/variables.py#L1438=I am developing a few plugins, e.g. for saltstack/salt, which are invoked with additional built ins by salt. Pylint is used in CI and the version maintained by renovate-bot. That highlighted the first failures here: jgraichen/salt-tower#25
Configuration
Command used
Pylint output
Expected behavior
Pylint version
OS / Environment
Debian 11
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: