Move the error node checking to a rule.

This commit is contained in:
Dave Halter
2017-08-19 12:43:47 +02:00
parent 5ff33c3736
commit 820e94e03a
4 changed files with 40 additions and 15 deletions

View File

@@ -692,8 +692,12 @@ class PEP8Normalizer(ErrorFinder):
return
if search_ancestor(node, 'error_node') is not None:
return
# Skip ErrorFinder here, because it has custom behavior.
super(ErrorFinder, self).add_issue(node, code, message)
if code in (901, 903):
# 901 and 903 are raised by the ErrorFinder.
super(PEP8Normalizer, self).add_issue(node, code, message)
else:
# Skip ErrorFinder here, because it has custom behavior.
super(ErrorFinder, self).add_issue(node, code, message)
class PEP8NormalizerConfig(ErrorFinderConfig):