[PATCH 5 of 7] tests: avoid tab indent on all kinds of lines of sh commands

Mads Kiilerich mads at kiilerich.com
Mon Apr 23 00:18:57 UTC 2012


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1335139008 -7200
# Branch stable
# Node ID 29fad63616f256d6da4cdf344dcb1c10a43d25d9
# Parent  086b1c861814e98868cb1959a00e66d4cf43f3c5
tests: avoid tab indent on all kinds of lines of sh commands

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -72,6 +72,7 @@
     (r'if\s*!', "don't use '!' to negate exit status"),
     (r'/dev/u?random', "don't use entropy, use /dev/zero"),
     (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
+    (r'^( *)\t', "don't use tabs to indent"),
   ],
   # warnings
   [
@@ -88,7 +89,6 @@
 ]
 
 uprefix = r"^  \$ "
-uprefixc = r"^  > "
 utestpats = [
   [
     (r'^(\S|  $ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"),
@@ -99,7 +99,6 @@
      "explicit exit code checks unnecessary"),
     (uprefix + r'set -e', "don't use set -e"),
     (uprefix + r'\s', "don't indent commands, use > for continued lines"),
-    (uprefixc + r'( *)\t', "don't use tabs to indent"),
   ],
   # warnings
   []
diff --git a/tests/test-convert-p4-filetypes b/tests/test-convert-p4-filetypes
--- a/tests/test-convert-p4-filetypes
+++ b/tests/test-convert-p4-filetypes
@@ -44,7 +44,7 @@
    T2=`echo $T | tr [:upper:] [:lower:]`
    case $T in
       apple)
-	 ;;
+         ;;
       symlink*)
          echo "this is target $T" >target_$T2
          ln -s target_$T file_$T2
@@ -52,7 +52,7 @@
          p4 add -t $T file_$T2
          ;;
       binary*)
-	 python -c "file('file_$T2', 'wb').write('this is $T')"
+         python -c "file('file_$T2', 'wb').write('this is $T')"
          p4 add -t $T file_$T2
          ;;
       *)



More information about the Mercurial-devel mailing list