Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 19501:725507cd5216 stable
check-code: add a check for the next() builtin, which was new in 2.6
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Thu, 25 Jul 2013 10:44:51 -0400 |
parents | 3119dc155ac2 |
children | cf6b086d64cc |
comparison
equal
deleted
inserted
replaced
19500:a96565abbd59 | 19501:725507cd5216 |
---|---|
171 (r'(\w|\)),\w', "missing whitespace after ,"), | 171 (r'(\w|\)),\w', "missing whitespace after ,"), |
172 (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"), | 172 (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"), |
173 (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"), | 173 (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"), |
174 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' | 174 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' |
175 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'), | 175 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'), |
176 (r'(?<!def)(\s+|^|\()next\(.+\)', | |
177 'no next(foo) in Python 2.4 and 2.5, use foo.next() instead'), | |
176 (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?' | 178 (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?' |
177 r'((?:\n|\1\s.*\n)+?)\1finally:', | 179 r'((?:\n|\1\s.*\n)+?)\1finally:', |
178 'no yield inside try/finally in Python 2.4'), | 180 'no yield inside try/finally in Python 2.4'), |
179 (r'.{81}', "line too long"), | 181 (r'.{81}', "line too long"), |
180 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), | 182 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), |