[PATCH 2 of 3 stable] check-code: fix check for trailing whitespace on empty lines

Mads Kiilerich mads at kiilerich.com
Wed Aug 8 11:11:51 CDT 2012


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1344442230 -7200
# Branch stable
# Node ID 689793034d8fca445b8371b5b3ab995a038965f8
# Parent  511cc5665914ce79f46ed49ef3d9b6390f9ff224
check-code: fix check for trailing whitespace on empty lines

It seems like the intention with c7d23b4ca4ba was to catch lines with only
one whitespace too.

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -91,7 +91,7 @@
 uprefix = r"^  \$ "
 utestpats = [
   [
-    (r'^(\S|  \$ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"),
+    (r'^(\S.*|  \$ .*|)[ \t]\n', "trailing whitespace on non-output"),
     (uprefix + r'.*\|\s*sed[^|>\n]*\n',
      "use regex test output patterns instead of sed"),
     (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"),
diff --git a/tests/test-basic.t b/tests/test-basic.t
--- a/tests/test-basic.t
+++ b/tests/test-basic.t
@@ -33,7 +33,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg identify -n
   0
- 
+
 
 Poke around at hashes:
 
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -260,7 +260,7 @@
      Z                         2:0d2164f0ce0d
      foo                       -1:000000000000
      foobar                    1:9b140be10808
- 
+
   $ cd ..
 
 Pushing a bookmark should only push the changes required by that
diff --git a/tests/test-encoding.t b/tests/test-encoding.t
--- a/tests/test-encoding.t
+++ b/tests/test-encoding.t
@@ -248,5 +248,5 @@
 
   $ HGENCODING=latin-1 hg up `cat latin-1-tag`
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
- 
+
   $ cd ..
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -80,7 +80,7 @@
   $ rm sub/unknown
 
 Remove both largefiles and normal files.
- 
+
   $ hg remove normal1 large1
   $ hg status large1
   R large1
diff --git a/tests/test-rebase-bookmarks.t b/tests/test-rebase-bookmarks.t
--- a/tests/test-rebase-bookmarks.t
+++ b/tests/test-rebase-bookmarks.t
@@ -23,7 +23,7 @@
   adding b
   $ hg book 'X'
   $ hg book 'Y'
- 
+
   $ echo c > c
   $ hg ci -Am C
   adding c
@@ -47,7 +47,7 @@
   |/
   o  0: 'A' bookmarks:
   
- 
+
 Move only rebased bookmarks
 
   $ cd ..
diff --git a/tests/test-subrepo-deep-nested-change.t b/tests/test-subrepo-deep-nested-change.t
--- a/tests/test-subrepo-deep-nested-change.t
+++ b/tests/test-subrepo-deep-nested-change.t
@@ -100,7 +100,7 @@
    revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
 
 Check that deep archiving works
- 
+
   $ cd cloned
   $ echo 'test' > sub1/sub2/test.txt
   $ hg --config extensions.largefiles=! add sub1/sub2/test.txt


More information about the Mercurial-devel mailing list