comparison contrib/check-code.py @ 25200:3613819fb05f

check-code: drop ban of 'val if cond else otherval' construct We now have access to this horrible but less bad than 'cond and val or otherval' syntax.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 18 May 2015 16:18:18 -0500
parents db77ff0b63da
children a39c35e8e559
comparison
equal deleted inserted replaced
25199:e78447e61624 25200:3613819fb05f
237 # (r'class\s[A-Z][^\(]*\((?!Exception)', 237 # (r'class\s[A-Z][^\(]*\((?!Exception)',
238 # "don't capitalize non-exception classes"), 238 # "don't capitalize non-exception classes"),
239 # (r'in range\(', "use xrange"), 239 # (r'in range\(', "use xrange"),
240 # (r'^\s*print\s+', "avoid using print in core and extensions"), 240 # (r'^\s*print\s+', "avoid using print in core and extensions"),
241 (r'[\x80-\xff]', "non-ASCII character literal"), 241 (r'[\x80-\xff]', "non-ASCII character literal"),
242 (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
243 (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist), 242 (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
244 "gratuitous whitespace after Python keyword"), 243 "gratuitous whitespace after Python keyword"),
245 (r'([\(\[][ \t]\S)|(\S[ \t][\)\]])', "gratuitous whitespace in () or []"), 244 (r'([\(\[][ \t]\S)|(\S[ \t][\)\]])', "gratuitous whitespace in () or []"),
246 # (r'\s\s=', "gratuitous whitespace before ="), 245 # (r'\s\s=', "gratuitous whitespace before ="),
247 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S', 246 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S',