diff contrib/check-code.py @ 18959:2f6418d8a4c9

check-code: catch trailing space in comments
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 01:37:23 +0200
parents 4e7498a586e8
children 170fc0949fb6
line wrap: on
line diff
--- a/contrib/check-code.py	Mon Apr 15 01:37:23 2013 +0200
+++ b/contrib/check-code.py	Mon Apr 15 01:37:23 2013 +0200
@@ -19,7 +19,8 @@
 def reppython(m):
     comment = m.group('comment')
     if comment:
-        return "#" * len(comment)
+        l = len(comment.rstrip())
+        return "#" * l + comment[l:]
     return repquote(m)
 
 def repcomment(m):