comparison contrib/check-code.py @ 19745:22a70f31e3e9

check-code: add bracket style check
author Matt Mackall <mpm@selenic.com>
date Wed, 18 Sep 2013 14:36:19 -0500
parents 1abd45e2553a
children 6fb1b7728719
comparison
equal deleted inserted replaced
19744:06badf7d10dc 19745:22a70f31e3e9
285 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), 285 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
286 (r'.{81}', "line too long"), 286 (r'.{81}', "line too long"),
287 (r'(while|if|do|for)\(', "use space after while/if/do/for"), 287 (r'(while|if|do|for)\(', "use space after while/if/do/for"),
288 (r'return\(', "return is not a function"), 288 (r'return\(', "return is not a function"),
289 (r' ;', "no space before ;"), 289 (r' ;', "no space before ;"),
290 (r'[)][{]', "space between ) and {"),
290 (r'\w+\* \w+', "use int *foo, not int* foo"), 291 (r'\w+\* \w+', "use int *foo, not int* foo"),
291 (r'\W\([^\)]+\) \w+', "use (int)foo, not (int) foo"), 292 (r'\W\([^\)]+\) \w+', "use (int)foo, not (int) foo"),
292 (r'\w+ (\+\+|--)', "use foo++, not foo ++"), 293 (r'\w+ (\+\+|--)', "use foo++, not foo ++"),
293 (r'\w,\w', "missing whitespace after ,"), 294 (r'\w,\w', "missing whitespace after ,"),
294 (r'^[^#]\w[+/*]\w', "missing whitespace in expression"), 295 (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),