comparison contrib/check-code.py @ 25178:ebc41dae840a

check-code: drop the yield inside try/finally ban This is now possible with Python 2.6.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 18 May 2015 12:56:59 -0500
parents d28cc89d92f0
children 3ff2a5dc7c20
comparison
equal deleted inserted replaced
25177:c3459555318e 25178:ebc41dae840a
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'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'
221 r'((?:\n|\1\s.*\n)+?)\1finally:',
222 'no yield inside try/finally in Python 2.4'),
223 (r'.{81}', "line too long"), 220 (r'.{81}', "line too long"),
224 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), 221 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
225 (r'[^\n]\Z', "no trailing newline"), 222 (r'[^\n]\Z', "no trailing newline"),
226 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), 223 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
227 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', 224 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=',