Mercurial > hg
comparison contrib/check-code.py @ 30557:cbeb54ec0481
check-code: add a rule to forbid "cp -r"
See the commit message of the previous patch for the reason. In short,
according to the current POSIX standard, "-r" is "removed", and "-R" is the
current standard way to do "copy file hierarchies".
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 30 Nov 2016 19:23:04 +0000 |
parents | b4c0f8d5edd2 |
children | 01721d382c16 |
comparison
equal
deleted
inserted
replaced
30556:c059286a0f9c | 30557:cbeb54ec0481 |
---|---|
140 (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"), | 140 (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"), |
141 (r'\butil\.Abort\b', "directly use error.Abort"), | 141 (r'\butil\.Abort\b', "directly use error.Abort"), |
142 (r'\|&', "don't use |&, use 2>&1"), | 142 (r'\|&', "don't use |&, use 2>&1"), |
143 (r'\w = +\w', "only one space after = allowed"), | 143 (r'\w = +\w', "only one space after = allowed"), |
144 (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"), | 144 (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"), |
145 (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'") | 145 (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'"), |
146 (r'cp.* -r ', "don't use 'cp -r', use 'cp -R'"), | |
146 ], | 147 ], |
147 # warnings | 148 # warnings |
148 [ | 149 [ |
149 (r'^function', "don't use 'function', use old style"), | 150 (r'^function', "don't use 'function', use old style"), |
150 (r'^diff.*-\w*N', "don't use 'diff -N'"), | 151 (r'^diff.*-\w*N', "don't use 'diff -N'"), |