comparison contrib/check-code.py @ 25142:24140873ca4c

check-code: lift the ban on 'next()' 'next' is supported by Python2.6 the new lowest version supported by Mercurial.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 17 May 2015 17:47:42 -0700
parents 3ea8d6b5e665
children 3b5cd6f13dcc
comparison
equal deleted inserted replaced
25141:3ea8d6b5e665 25142:24140873ca4c
215 (r'[^_]_\([ \t\n]*(?:"[^"]+"[ \t\n+]*)+%', "don't use % inside _()"), 215 (r'[^_]_\([ \t\n]*(?:"[^"]+"[ \t\n+]*)+%', "don't use % inside _()"),
216 (r"[^_]_\([ \t\n]*(?:'[^']+'[ \t\n+]*)+%", "don't use % inside _()"), 216 (r"[^_]_\([ \t\n]*(?:'[^']+'[ \t\n+]*)+%", "don't use % inside _()"),
217 (r'(\w|\)),\w', "missing whitespace after ,"), 217 (r'(\w|\)),\w', "missing whitespace after ,"),
218 (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"), 218 (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
219 (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"), 219 (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
220 (r'(?<!def)(\s+|^|\()next\(.+\)',
221 'no next(foo) in Python 2.4 and 2.5, use foo.next() instead'),
222 (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?' 220 (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'
223 r'((?:\n|\1\s.*\n)+?)\1finally:', 221 r'((?:\n|\1\s.*\n)+?)\1finally:',
224 'no yield inside try/finally in Python 2.4'), 222 'no yield inside try/finally in Python 2.4'),
225 (r'.{81}', "line too long"), 223 (r'.{81}', "line too long"),
226 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), 224 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),