Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 10286:cc0340ef47f7
check-code: check thyself
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 25 Jan 2010 01:23:34 -0600 |
parents | e7d3b509af8b |
children | 5da892be3497 |
comparison
equal
deleted
inserted
replaced
10285:61f4ea277f23 | 10286:cc0340ef47f7 |
---|---|
66 (r'^\s+\w+=\w+[^,)]$', "missing whitespace in assignment"), | 66 (r'^\s+\w+=\w+[^,)]$', "missing whitespace in assignment"), |
67 (r'.{85}', "line too long"), | 67 (r'.{85}', "line too long"), |
68 (r'[^\n]\Z', "no trailing newline"), | 68 (r'[^\n]\Z', "no trailing newline"), |
69 # (r'^\s+[^_ ][^_. ]+_[^_]+\s*=', "don't use underbars in identifiers"), | 69 # (r'^\s+[^_ ][^_. ]+_[^_]+\s*=', "don't use underbars in identifiers"), |
70 # (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"), | 70 # (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"), |
71 (r'^\s*(if|while|def|class|except|try)\s[^[]*:\s*[^\]#\s]+', "linebreak after :"), | 71 (r'^\s*(if|while|def|class|except|try)\s[^[]*:\s*[^\]#\s]+', |
72 "linebreak after :"), | |
72 (r'class\s[^(]:', "old-style class, use class foo(object)"), | 73 (r'class\s[^(]:', "old-style class, use class foo(object)"), |
73 (r'^\s+except\(', "except isn't a function"), | 74 (r'^\s+except\(', "except isn't a function"), |
74 # (r'class\s[A-Z][^\(]*\((?!Exception)', | 75 # (r'class\s[A-Z][^\(]*\((?!Exception)', |
75 # "don't capitalize non-exception classes"), | 76 # "don't capitalize non-exception classes"), |
76 # (r'in range\(', "use xrange"), | 77 # (r'in range\(', "use xrange"), |