changeset 2278:9df10b5358b5

test_sourcecode: add test for trailing spaces (currently disabled), other minor changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 02 Jul 2007 16:32:28 +0200
parents 5638ffa2fb38
children 938d6761519f
files MoinMoin/_tests/test_sourcecode.py
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_sourcecode.py	Mon Jul 02 16:23:12 2007 +0200
+++ b/MoinMoin/_tests/test_sourcecode.py	Mon Jul 02 16:32:28 2007 +0200
@@ -1,8 +1,12 @@
 """
-Verify that the MoinMoin source files have no tabs.
-
+Verify that the MoinMoin source files
+ * have no tabs,
+ * end with \n,
+ * have no crlf (Windows style) line endings,
+ * have no trailing spaces at line endings (test currently disabled).
+ 
 @copyright: 2006 by Armin Rigo,
-            2007 adapted for MoinMoin by MoinMoin:ThomasWaldmann.
+            2007 adapted and extended for MoinMoin by MoinMoin:ThomasWaldmann.
 @license: MIT licensed
 """
 
@@ -18,7 +22,7 @@
     '/wiki/htdocs/applets/FCKeditor', # 3rd party GUI editor
 ]
 
-def test_no_tabs():
+def test_sourcecode():
     def walk(reldir):
         if reldir in EXCLUDE:
             return
@@ -34,6 +38,8 @@
                 assert '\t' not in data, "%r contains tabs (please use 4 space chars for indenting)!" % (reldir,)
                 assert not data or data.endswith('\n'), "%r does not end with a newline char!" % (reldir,)
                 assert '\r\n' not in data, "%r contains crlf line endings (please use UNIX style, lf only)!" % (reldir,)
+                #triggers too often currently, developers please clean up your src files!
+                #assert ' \n' not in data, "%r contains line(s) with trailing spaces!" % (reldir,)
         elif os.path.isdir(path):
             for entry in os.listdir(path):
                 if not entry.startswith('.'):