changeset 30563: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 c059286a0f9c
children d83ca854fa21
files contrib/check-code.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Wed Nov 30 19:25:18 2016 +0000
+++ b/contrib/check-code.py	Wed Nov 30 19:23:04 2016 +0000
@@ -142,7 +142,8 @@
     (r'\|&', "don't use |&, use 2>&1"),
     (r'\w =  +\w', "only one space after = allowed"),
     (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"),
-    (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'")
+    (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'"),
+    (r'cp.* -r ', "don't use 'cp -r', use 'cp -R'"),
   ],
   # warnings
   [