[PATCH 2 of 3] check-code: allow only-whitespace lines in tests

Matt Mackall mpm at selenic.com
Fri Jan 8 12:46:57 CST 2016


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1452278102 21600
#      Fri Jan 08 12:35:02 2016 -0600
# Node ID 54875580a56db3682f5dc4cadd65c7b6d9176cd7
# Parent  c7316bc6af8d25a80f92ac22fc9f2023f595ccb6
check-code: allow only-whitespace lines in tests

These turn out to be necessary to embed diffs with blank lines in test
input. So we now complain about whitespace following a character.

diff -r c7316bc6af8d -r 54875580a56d contrib/check-code.py
--- a/contrib/check-code.py	Thu Dec 10 12:56:23 2015 -0600
+++ b/contrib/check-code.py	Fri Jan 08 12:35:02 2016 -0600
@@ -148,7 +148,7 @@
 uprefix = r"^  \$ "
 utestpats = [
   [
-    (r'^(\S.*||  [$>] .*)[ \t]\n', "trailing whitespace on non-output"),
+    (r'^(\S.*||  [$>] \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"),


More information about the Mercurial-devel mailing list