-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Labels
C: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkControl flowRequires control flow understandingRequires control flow understandingEnhancement ✨Improvement to a componentImprovement to a componentFalse Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the codeHigh priorityIssue with more than 10 reactionsIssue with more than 10 reactions
Milestone
Description
Running pylint on this simple example does not detect that x can be used before assignment. This is a very common programming mistake and should be caught.
def a_function(d):
if d:
x=1
return xCurrent behavior - Fails to detect x is used before assignment
Expected behavior: detect variable use inside logic branches.
pylint --version output: pylint-2 1.7.4
gcolombeau, iNishant, AnselmC, skonieczny, tomaszd and 1 more
Metadata
Metadata
Assignees
Labels
C: used-before-assignmentIssues related to 'used-before-assignment' checkIssues related to 'used-before-assignment' checkControl flowRequires control flow understandingRequires control flow understandingEnhancement ✨Improvement to a componentImprovement to a componentFalse Negative 🦋No message is emitted but something is wrong with the codeNo message is emitted but something is wrong with the codeHigh priorityIssue with more than 10 reactionsIssue with more than 10 reactions