summaryrefslogtreecommitdiff
path: root/pylint/checkers/variables.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-12-04 11:35:23 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2016-12-04 11:40:37 +0200
commit0b58de8f6e923a6331aa227f70867b0276a32ff0 (patch)
tree8fa6cdbe27a159a18341067dea539c5e701026ec /pylint/checkers/variables.py
parent5b6d225789b7abdbe7a9156bf7c4bf019783a271 (diff)
downloadpylint-git-0b58de8f6e923a6331aa227f70867b0276a32ff0.tar.gz
Skip checking only of arguments when in a singledispatched function.
Diffstat (limited to 'pylint/checkers/variables.py')
-rw-r--r--pylint/checkers/variables.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index c8b49f7b6..e3257de6e 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -662,6 +662,9 @@ class VariablesChecker(BaseChecker):
if any(node.name.startswith(cb) or node.name.endswith(cb)
for cb in self.config.callbacks):
return
+ # Don't check arguments of singledispatch.register function.
+ if utils.is_registered_in_singledispatch_function(node):
+ return
self.add_message('unused-argument', args=name, node=stmt,
confidence=confidence)
else:
@@ -692,13 +695,8 @@ class VariablesChecker(BaseChecker):
if is_method and node.is_abstract():
return
- # Don't check arguments of singledispatch.register function.
- if utils.is_registered_in_singledispatch_function(node):
- return
-
global_names = _flattened_scope_names(node.nodes_of_class(astroid.Global))
nonlocal_names = _flattened_scope_names(node.nodes_of_class(astroid.Nonlocal))
-
for name, stmts in six.iteritems(not_consumed):
self._check_is_unused(name, node, stmts[0], global_names, nonlocal_names)