Patchwork [4,of,5] check-code: check that '>' is used for continued lines

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 3, 2013, 12:57 p.m.
Message ID <fff081bdc9f40096c5b3.1380805022@mk-desktop>
Download mbox | patch
Permalink /patch/2721/
State Accepted
Commit b3de50b0c7aa464fdf73ece8c4e5ee8af59b4242
Headers show

Comments

Mads Kiilerich - Oct. 3, 2013, 12:57 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1380804647 -7200
#      Thu Oct 03 14:50:47 2013 +0200
# Node ID fff081bdc9f40096c5b344703653afd689ce8ea3
# Parent  62dfe5a111163d9b724e1f824bf63f5d40ae0902
check-code: check that '>' is used for continued lines

Continued lines do not get the SALT mangling.

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -120,7 +120,7 @@ 
     (uprefix + r'.*\|\| echo.*(fail|error)',
      "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"),
+    (uprefix + r'(\s|fi\b|done\b)', "use > for continued lines"),
     (r'^  saved backup bundle to \$TESTTMP.*\.hg$', winglobmsg),
     (r'^  changeset .* references (corrupted|missing) \$TESTTMP/.*[^)]$',
      winglobmsg),
diff --git a/tests/test-walk.t b/tests/test-walk.t
--- a/tests/test-walk.t
+++ b/tests/test-walk.t
@@ -3,11 +3,11 @@ 
   $ mkdir -p beans
   $ for b in kidney navy turtle borlotti black pinto; do
   >     echo $b > beans/$b
-  $ done
+  > done
   $ mkdir -p mammals/Procyonidae
   $ for m in cacomistle coatimundi raccoon; do
   >     echo $m > mammals/Procyonidae/$m
-  $ done
+  > done
   $ echo skunk > mammals/skunk
   $ echo fennel > fennel
   $ echo fenugreek > fenugreek