Index: flake8-eyeo/flake8_eyeo.py |
=================================================================== |
--- a/flake8-eyeo/flake8_eyeo.py |
+++ b/flake8-eyeo/flake8_eyeo.py |
@@ -353,16 +353,12 @@ |
self._visit_hash_keys(node.elts, 'item in set') |
-class ASTChecker(object): |
- def __init__(self, tree, filename): |
- self.tree = tree |
+def check_ast(tree): |
Sebastian Noack
2017/10/10 20:15:32
This was merely a class because flake8 2 required
|
+ visitor = TreeVisitor() |
+ visitor.visit(tree) |
- def run(self): |
- visitor = TreeVisitor() |
- visitor.visit(self.tree) |
- |
- for node, error in visitor.errors: |
- yield (node.lineno, node.col_offset, error, type(self)) |
+ for node, error in visitor.errors: |
+ yield (node.lineno, node.col_offset, error, None) |
Sebastian Noack
2017/10/10 20:15:32
The forth argument is obsolete and unused. However
|
def check_non_default_encoding(physical_line, line_number): |
@@ -471,7 +467,7 @@ |
return [] |
-for checker in [ASTChecker, check_non_default_encoding, |
+for checker in [check_ast, check_non_default_encoding, |
check_quotes, check_redundant_parenthesis]: |
checker.name = 'eyeo' |
checker.version = __version__ |