comparison contrib/check-code.py @ 33285:98f6c25aaf61

contrib: widen the "don't use `python`" net a little I'm still cleaning this up, but it's easier to do in bite-size chunks like this than all at once. The negative lookahead avoids one false positive category from some output related to finding Subversion bindings. Differential Revision: https://phab.mercurial-scm.org/D13
author Augie Fackler <augie@google.com>
date Tue, 20 Jun 2017 17:25:57 -0400
parents 20ed0e6a4905
children f08a178adadf
comparison
equal deleted inserted replaced
33284:b2670290eab4 33285:98f6c25aaf61
136 (r'^( *)\t', "don't use tabs to indent"), 136 (r'^( *)\t', "don't use tabs to indent"),
137 (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)', 137 (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)',
138 "put a backslash-escaped newline after sed 'i' command"), 138 "put a backslash-escaped newline after sed 'i' command"),
139 (r'^diff *-\w*[uU].*$\n(^ \$ |^$)', "prefix diff -u/-U with cmp"), 139 (r'^diff *-\w*[uU].*$\n(^ \$ |^$)', "prefix diff -u/-U with cmp"),
140 (r'^\s+(if)? diff *-\w*[uU]', "prefix diff -u/-U with cmp"), 140 (r'^\s+(if)? diff *-\w*[uU]', "prefix diff -u/-U with cmp"),
141 (r'python\s.+\.py', "don't use 'python', use '$PYTHON'"), 141 (r'\spython\s(?!bindings)', "don't use 'python', use '$PYTHON'"),
142 (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"), 142 (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"),
143 (r'\butil\.Abort\b', "directly use error.Abort"), 143 (r'\butil\.Abort\b', "directly use error.Abort"),
144 (r'\|&', "don't use |&, use 2>&1"), 144 (r'\|&', "don't use |&, use 2>&1"),
145 (r'\w = +\w', "only one space after = allowed"), 145 (r'\w = +\w', "only one space after = allowed"),
146 (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"), 146 (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"),