[PATCH] check-code: ban grep's context flags (-A/-B/-C) since they're not on Solaris

danek.duvall at oracle.com danek.duvall at oracle.com
Tue Jun 6 16:00:35 UTC 2017


# HG changeset patch
# User Danek Duvall <danek.duvall at oracle.com>
# Date 1496764707 25200
#      Tue Jun 06 08:58:27 2017 -0700
# Node ID 0250869949d7d7e5e9c5b28d3c7cca61a46c80f3
# Parent  67209fdbca98cf2a38b05cb06f093dc376803590
check-code: ban grep's context flags (-A/-B/-C) since they're not on Solaris

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -145,6 +145,7 @@ testpats = [
     (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'cp.* -r ', "don't use 'cp -r', use 'cp -R'"),
+    (r'grep.* -[ABC] ', "don't use grep's context flags"),
   ],
   # warnings
   [


More information about the Mercurial-devel mailing list