Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 32941:20ed0e6a4905
contrib: add check-code rule to enforce non-use of `python` in tests
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 20 Jun 2017 09:49:43 -0400 |
parents | 0c09afdf5704 |
children | 98f6c25aaf61 |
comparison
equal
deleted
inserted
replaced
32940:75be14993fda | 32941:20ed0e6a4905 |
---|---|
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'seq ', "don't use 'seq', use $TESTDIR/seq.py"), | 142 (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"), |
142 (r'\butil\.Abort\b', "directly use error.Abort"), | 143 (r'\butil\.Abort\b', "directly use error.Abort"), |
143 (r'\|&', "don't use |&, use 2>&1"), | 144 (r'\|&', "don't use |&, use 2>&1"), |
144 (r'\w = +\w', "only one space after = allowed"), | 145 (r'\w = +\w', "only one space after = allowed"), |
145 (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"), |