comparison contrib/check-code.py @ 11345:4b81f82b03e3

check-code: reformat long lines
author Martin Geisler <mg@aragost.com>
date Tue, 15 Jun 2010 10:01:55 +0200
parents f325db39c8b9
children eaa7666ad53f
comparison
equal deleted inserted replaced
11344:32a9744acf1e 11345:4b81f82b03e3
90 # (r'in range\(', "use xrange"), 90 # (r'in range\(', "use xrange"),
91 # (r'^\s*print\s+', "avoid using print in core and extensions"), 91 # (r'^\s*print\s+', "avoid using print in core and extensions"),
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)\(', "any/all/format not available in Python 2.4"), 95 (r'(?<!def)\s+(any|all|format)\(',
96 "any/all/format not available in Python 2.4"),
96 (r'if\s.*\selse', "if ... else form not available in Python 2.4"), 97 (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
97 (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"), 98 (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"),
98 # (r'\s\s=', "gratuitous whitespace before ="), 99 # (r'\s\s=', "gratuitous whitespace before ="),
99 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', "missing whitespace around operator"), 100 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S',
100 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\s', "missing whitespace around operator"), 101 "missing whitespace around operator"),
101 (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', "missing whitespace around operator"), 102 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\s',
102 (r'[^+=*!<>&| -](\s=|=\s)[^= ]', "wrong whitespace around ="), 103 "missing whitespace around operator"),
104 (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=)\S',
105 "missing whitespace around operator"),
106 (r'[^+=*!<>&| -](\s=|=\s)[^= ]',
107 "wrong whitespace around ="),
103 (r'raise Exception', "don't raise generic exceptions"), 108 (r'raise Exception', "don't raise generic exceptions"),
104 (r'ui\.(status|progress|write|note)\([\'\"]x', 109 (r'ui\.(status|progress|write|note)\([\'\"]x',
105 "warning: unwrapped ui message"), 110 "warning: unwrapped ui message"),
106 ] 111 ]
107 112