comparison contrib/check-code.py @ 22448:8afaf7cef35a

check-code: look for misuse of __bool__
author Yuya Nishihara <yuya@tcha.org>
date Wed, 17 Sep 2014 00:28:37 +0900
parents 2965804483e3
children 22e76e370611
comparison
equal deleted inserted replaced
22447:2642ce9be6ef 22448:8afaf7cef35a
297 (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'), 297 (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'),
298 (r':\n( )*( ){1,3}[^ ]', "must indent 4 spaces"), 298 (r':\n( )*( ){1,3}[^ ]', "must indent 4 spaces"),
299 (r'ui\.(status|progress|write|note|warn)\([\'\"]x', 299 (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
300 "missing _() in ui message (use () to hide false-positives)"), 300 "missing _() in ui message (use () to hide false-positives)"),
301 (r'release\(.*wlock, .*lock\)', "wrong lock release order"), 301 (r'release\(.*wlock, .*lock\)', "wrong lock release order"),
302 (r'\b__bool__\b', "__bool__ should be __nonzero__ in Python 2"),
302 ], 303 ],
303 # warnings 304 # warnings
304 [ 305 [
305 (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"), 306 (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"),
306 ] 307 ]