Mercurial > public > mercurial-scm > hg-stable
comparison contrib/check-code.py @ 11764:16723af520b0
check-code: added a check for calls to the builtin cmp function
author | Renato Cunha <renatoc@gmail.com> |
---|---|
date | Sat, 07 Aug 2010 16:13:53 -0300 |
parents | dad185761392 |
children | e1359ad582f6 |
comparison
equal
deleted
inserted
replaced
11763:69e0bcf36961 | 11764:16723af520b0 |
---|---|
72 pypats = [ | 72 pypats = [ |
73 (r'^\s*def\s*\w+\s*\(.*,\s*\(', | 73 (r'^\s*def\s*\w+\s*\(.*,\s*\(', |
74 "tuple parameter unpacking not available in Python 3+"), | 74 "tuple parameter unpacking not available in Python 3+"), |
75 (r'lambda\s*\(.*,.*\)', | 75 (r'lambda\s*\(.*,.*\)', |
76 "tuple parameter unpacking not available in Python 3+"), | 76 "tuple parameter unpacking not available in Python 3+"), |
77 (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"), | |
77 (r'\breduce\s*\(.*', "reduce is not available in Python 3+"), | 78 (r'\breduce\s*\(.*', "reduce is not available in Python 3+"), |
78 (r'\.has_key\b', "dict.has_key is not available in Python 3+"), | 79 (r'\.has_key\b', "dict.has_key is not available in Python 3+"), |
79 (r'^\s*\t', "don't use tabs"), | 80 (r'^\s*\t', "don't use tabs"), |
80 (r'\S;\s*\n', "semicolon"), | 81 (r'\S;\s*\n', "semicolon"), |
81 (r'\w,\w', "missing whitespace after ,"), | 82 (r'\w,\w', "missing whitespace after ,"), |