[PATCH 6 of 6 v3] contrib: add check-code rule to enforce non-use of `python` in tests

Augie Fackler raf at durin42.com
Tue Jun 20 10:10:41 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1497966583 14400
#      Tue Jun 20 09:49:43 2017 -0400
# Node ID e49236e4d9572e1c68e011b6fa6f4ea30a249072
# Parent  e55f8e37ac5ed7c3c7a768006a2ff7ec0b1fecb0
contrib: add check-code rule to enforce non-use of `python` in tests

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -138,6 +138,7 @@ testpats = [
      "put a backslash-escaped newline after sed 'i' command"),
     (r'^diff *-\w*[uU].*$\n(^  \$ |^$)', "prefix diff -u/-U with cmp"),
     (r'^\s+(if)? diff *-\w*[uU]', "prefix diff -u/-U with cmp"),
+    (r'python\s.+\.py', "don't use 'python', use '$PYTHON'"),
     (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"),
     (r'\butil\.Abort\b', "directly use error.Abort"),
     (r'\|&', "don't use |&, use 2>&1"),


More information about the Mercurial-devel mailing list