comparison 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
comparison
equal deleted inserted replaced
18958:c3b920980f22 18959:2f6418d8a4c9
17 return m.group('quote') + t + m.group('quote') 17 return m.group('quote') + t + m.group('quote')
18 18
19 def reppython(m): 19 def reppython(m):
20 comment = m.group('comment') 20 comment = m.group('comment')
21 if comment: 21 if comment:
22 return "#" * len(comment) 22 l = len(comment.rstrip())
23 return "#" * l + comment[l:]
23 return repquote(m) 24 return repquote(m)
24 25
25 def repcomment(m): 26 def repcomment(m):
26 return m.group(1) + "#" * len(m.group(2)) 27 return m.group(1) + "#" * len(m.group(2))
27 28