Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 18960:170fc0949fb6
check-code: check txt files for trailing whitespace
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 15 Apr 2013 01:37:23 +0200 |
parents | 2f6418d8a4c9 |
children | 341083b02d1b |
comparison
equal
deleted
inserted
replaced
18959:2f6418d8a4c9 | 18960:170fc0949fb6 |
---|---|
235 ((?P<quote>('''|\"\"\"|(?<!')'(?!')|(?<!")"(?!"))) | 235 ((?P<quote>('''|\"\"\"|(?<!')'(?!')|(?<!")"(?!"))) |
236 (?P<text>(([^\\]|\\.)*?)) | 236 (?P<text>(([^\\]|\\.)*?)) |
237 (?P=quote))""", reppython), | 237 (?P=quote))""", reppython), |
238 ] | 238 ] |
239 | 239 |
240 txtfilters = [] | |
241 | |
242 txtpats = [ | |
243 [ | |
244 ('\s$', 'trailing whitespace'), | |
245 ], | |
246 [] | |
247 ] | |
248 | |
240 cpats = [ | 249 cpats = [ |
241 [ | 250 [ |
242 (r'//', "don't use //-style comments"), | 251 (r'//', "don't use //-style comments"), |
243 (r'^ ', "don't use spaces to indent"), | 252 (r'^ ', "don't use spaces to indent"), |
244 (r'\S\t', "don't use tabs except for indent"), | 253 (r'\S\t', "don't use tabs except for indent"), |
290 ('unified test', r'.*\.t$', utestfilters, utestpats), | 299 ('unified test', r'.*\.t$', utestfilters, utestpats), |
291 ('layering violation repo in revlog', r'mercurial/revlog\.py', pyfilters, | 300 ('layering violation repo in revlog', r'mercurial/revlog\.py', pyfilters, |
292 inrevlogpats), | 301 inrevlogpats), |
293 ('layering violation ui in util', r'mercurial/util\.py', pyfilters, | 302 ('layering violation ui in util', r'mercurial/util\.py', pyfilters, |
294 inutilpats), | 303 inutilpats), |
304 ('txt', r'.*\.txt$', txtfilters, txtpats), | |
295 ] | 305 ] |
296 | 306 |
297 class norepeatlogger(object): | 307 class norepeatlogger(object): |
298 def __init__(self): | 308 def __init__(self): |
299 self._lastseen = None | 309 self._lastseen = None |