Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 16234:a6941d7033fa
check-code: check for % inside _()
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 08 Mar 2012 15:59:44 -0600 |
parents | c6c9b83a1e8a |
children | 0d175ac527c1 |
comparison
equal
deleted
inserted
replaced
16233:3f79b110c4f0 | 16234:a6941d7033fa |
---|---|
120 (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"), | 120 (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"), |
121 (r'\breduce\s*\(.*', "reduce is not available in Python 3+"), | 121 (r'\breduce\s*\(.*', "reduce is not available in Python 3+"), |
122 (r'\.has_key\b', "dict.has_key is not available in Python 3+"), | 122 (r'\.has_key\b', "dict.has_key is not available in Python 3+"), |
123 (r'^\s*\t', "don't use tabs"), | 123 (r'^\s*\t', "don't use tabs"), |
124 (r'\S;\s*\n', "semicolon"), | 124 (r'\S;\s*\n', "semicolon"), |
125 (r'[^_]_\("[^"]+"\s*%', "don't use % inside _()"), | |
126 (r"[^_]_\('[^']+'\s*%", "don't use % inside _()"), | |
125 (r'\w,\w', "missing whitespace after ,"), | 127 (r'\w,\w', "missing whitespace after ,"), |
126 (r'\w[+/*\-<>]\w', "missing whitespace in expression"), | 128 (r'\w[+/*\-<>]\w', "missing whitespace in expression"), |
127 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), | 129 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), |
128 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' | 130 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' |
129 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'), | 131 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'), |