changeset 1373:7f36753d9fe3

move the ignores for pep8 checker to a PEP8IGNORE constant
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 10 Jun 2012 18:37:11 +0200
parents dd9450af63ae
children 04a434634ef9
files MoinMoin/_tests/test_sourcecode.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_sourcecode.py	Sun Jun 10 18:26:42 2012 +0200
+++ b/MoinMoin/_tests/test_sourcecode.py	Sun Jun 10 18:37:11 2012 +0200
@@ -22,6 +22,11 @@
     moindir/'_tests/wiki', # this is our test wiki
 ])
 
+PEP8IGNORE = """
+    E202 E221 E222 E241 E301 E302 E401 E501 E701 W391 W601 W602
+    E121 E122 E123 E124 E125 E126 E127 E128 E225 E251 E261 E262 E271 E293 E303 E502
+""".split()
+
 TRAILING_SPACES = 'nochange' # 'nochange' or 'fix'
                              # use 'fix' with extreme caution and in a separate changeset!
 FIX_TS_RE = re.compile(r' +$', re.M) # 'fix' mode: everything matching the trailing space re will be removed
@@ -68,7 +73,7 @@
 
 def pep8_error_count(path):
     # process_options initializes some data structures and MUST be called before each Checker().check_all()
-    pep8.process_options(['pep8', '--ignore=E202,E221,E222,E241,E301,E302,E401,E501,E701,W391,W601,W602,E261,E121,E122,E123,E124,E125,E126,E127,E128,E225,E251,E262,E271,E293,E303,E502', '--show-source', 'dummy_path'])
+    pep8.process_options(['pep8', '--ignore=%s' % ','.join(PEP8IGNORE), '--show-source', 'dummy_path'])
     error_count = pep8.Checker(path).check_all()
     return error_count