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

login
register
mail settings
Submitter Augie Fackler
Date June 20, 2017, 2:10 p.m.
Message ID <e49236e4d9572e1c68e0.1497967841@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/21531/
State Accepted
Headers show

Comments

Augie Fackler - June 20, 2017, 2:10 p.m.
# HG changeset patch
# User Augie Fackler <augie@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

Patch

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"),