comparison contrib/check-code.py @ 11522:eaa7666ad53f stable

check-code: add test for callable
author Martin Geisler <mg@aragost.com>
date Fri, 09 Jul 2010 14:01:55 +0200
parents 4b81f82b03e3
children d5d4e6a30613 6fcc066c0c2c
comparison
equal deleted inserted replaced
11521:3efadce5b346 11522:eaa7666ad53f
92 (r'[\x80-\xff]', "non-ASCII character literal"), 92 (r'[\x80-\xff]', "non-ASCII character literal"),
93 (r'("\')\.format\(', "str.format() not available in Python 2.4"), 93 (r'("\')\.format\(', "str.format() not available in Python 2.4"),
94 (r'^\s*with\s+', "with not available in Python 2.4"), 94 (r'^\s*with\s+', "with not available in Python 2.4"),
95 (r'(?<!def)\s+(any|all|format)\(', 95 (r'(?<!def)\s+(any|all|format)\(',
96 "any/all/format not available in Python 2.4"), 96 "any/all/format not available in Python 2.4"),
97 (r'(?<!def)\s+(callable)\(',
98 "callable not available in Python 3, use hasattr(f, '__call__')"),
97 (r'if\s.*\selse', "if ... else form not available in Python 2.4"), 99 (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
98 (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"), 100 (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"),
99 # (r'\s\s=', "gratuitous whitespace before ="), 101 # (r'\s\s=', "gratuitous whitespace before ="),
100 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', 102 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S',
101 "missing whitespace around operator"), 103 "missing whitespace around operator"),