From 7095f4766593cc2b55669b032d7de0fa13fcb4c7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 29 Jan 2015 15:35:06 +1100 Subject: cleanup: pep8 also remove empty class parenthesis --- tests/python/pep8.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/python/pep8.py b/tests/python/pep8.py index 7713ffeaaa4..551e2a87e9b 100644 --- a/tests/python/pep8.py +++ b/tests/python/pep8.py @@ -95,13 +95,23 @@ def main(): print(" %s" % f) # strict imports - print("\n\n\n# running pep8...") + print("\n\n\n# checking imports...") import re import_check = re.compile(r"\s*from\s+[A-z\.]+\s+import \*\s*") for f, pep8_type in files: for i, l in enumerate(open(f, 'r', encoding='utf8')): if import_check.match(l): print("%s:%d:0: global import bad practice" % (f, i + 1)) + del re, import_check + + print("\n\n\n# checking class definitions...") + import re + class_check = re.compile(r"\s*class\s+.*\(\):.*") + for f, pep8_type in files: + for i, l in enumerate(open(f, 'r', encoding='utf8')): + if class_check.match(l): + print("%s:%d:0: empty class (), remove" % (f, i + 1)) + del re, class_check print("\n\n\n# running pep8...") -- cgit v1.2.3