Mercurial > hg
comparison contrib/check-code.py @ 16428:9b26d541e972
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 14 Apr 2012 01:39:35 -0500 |
parents | 1a420761fcb7 c3aedd526d53 |
children | 3c4910364797 |
comparison
equal
deleted
inserted
replaced
16427:d54d4de56aa7 | 16428:9b26d541e972 |
---|---|
178 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"), | 178 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"), |
179 (r' [=!]=\s+(True|False|None)', | 179 (r' [=!]=\s+(True|False|None)', |
180 "comparison with singleton, use 'is' or 'is not' instead"), | 180 "comparison with singleton, use 'is' or 'is not' instead"), |
181 (r'^\s*(while|if) [01]:', | 181 (r'^\s*(while|if) [01]:', |
182 "use True/False for constant Boolean expression"), | 182 "use True/False for constant Boolean expression"), |
183 (r'(?<!def)\s+hasattr', | 183 (r'(?:(?<!def)\s+|\()hasattr', |
184 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), | 184 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), |
185 (r'opener\([^)]*\).read\(', | 185 (r'opener\([^)]*\).read\(', |
186 "use opener.read() instead"), | 186 "use opener.read() instead"), |
187 (r'BaseException', 'not in Py2.4, use Exception'), | 187 (r'BaseException', 'not in Py2.4, use Exception'), |
188 (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'), | 188 (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'), |