Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 12964:34034e55424f
check-code: using and/or/not as a function is bad style
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Thu, 11 Nov 2010 00:08:09 +0100 |
parents | c7d23b4ca4ba |
children | 8b167ee8242f |
comparison
equal
deleted
inserted
replaced
12963:e80128e40c04 | 12964:34034e55424f |
---|---|
116 # (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"), | 116 # (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"), |
117 (r'^\s*(if|while|def|class|except|try)\s[^[]*:\s*[^\]#\s]+', | 117 (r'^\s*(if|while|def|class|except|try)\s[^[]*:\s*[^\]#\s]+', |
118 "linebreak after :"), | 118 "linebreak after :"), |
119 (r'class\s[^(]:', "old-style class, use class foo(object)"), | 119 (r'class\s[^(]:', "old-style class, use class foo(object)"), |
120 (r'^\s+del\(', "del isn't a function"), | 120 (r'^\s+del\(', "del isn't a function"), |
121 (r'\band\(', "and isn't a function"), | |
122 (r'\bor\(', "or isn't a function"), | |
123 (r'\bnot\(', "not isn't a function"), | |
121 (r'^\s+except\(', "except isn't a function"), | 124 (r'^\s+except\(', "except isn't a function"), |
122 (r',]', "unneeded trailing ',' in list"), | 125 (r',]', "unneeded trailing ',' in list"), |
123 # (r'class\s[A-Z][^\(]*\((?!Exception)', | 126 # (r'class\s[A-Z][^\(]*\((?!Exception)', |
124 # "don't capitalize non-exception classes"), | 127 # "don't capitalize non-exception classes"), |
125 # (r'in range\(', "use xrange"), | 128 # (r'in range\(', "use xrange"), |