-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
False positive unused-variable
for TYPE_CHECKING
imports
#8696
Labels
C: used-before-assignment
Issues related to 'used-before-assignment' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Comments
zenlyj
added
the
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
label
May 17, 2023
jacobtylerwalls
added
False Positive 🦟
A message is emitted but nothing is wrong with the code
C: used-before-assignment
Issues related to 'used-before-assignment' check
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
May 17, 2023
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 23, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. Closes pylint-dev#8696
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 23, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. Closes pylint-dev#8696
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 31, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. Closes pylint-dev#8696
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Jun 6, 2023
…in a ``if TYPE_CHECKING:`` block and ``allow-global-unused-variables`` is set to ``no`` in the configuration. (#8713) (#8744) Closes #8696 (cherry picked from commit e5584d5) Co-authored-by: Mark Byrne <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C: used-before-assignment
Issues related to 'used-before-assignment' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
When
allow-global-unused-variables
is set tofalse
in the configuration, theunused-variable
warning is raised for imports made underTYPE_CHECKING
guard clauses. This behavior seems inconsistent withunused-import
, which is not raised for such cases.Configuration
Command used
Pylint output
Expected behavior
No warnings raised.
Pylint version
OS / Environment
WSL2 Ubuntu 20.04 LTS
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: