[PATCH 3 of 6 v2] check-code: only treat a # as a line in a t-test if it has a space before it

Augie Fackler raf at durin42.com
Tue Jul 12 15:49:50 EDT 2016


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1468352057 14400
#      Tue Jul 12 15:34:17 2016 -0400
# Node ID 22e0c03114ed488eb162b8dd9f06593f0524f39f
# Parent  8b22851ac225ea493b20c76edd45da96c744f1e8
check-code: only treat a # as a line in a t-test if it has a space before it

Prior to this, check-code wouldn't notice things like (glob)
annotations or similar in a test if they were after a # anywhere in
the line. This resolves a defect in a future change, and also exposed
a couple of small spots that needed some attention.

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -224,7 +224,7 @@ for i in [0, 1]:
 
 utestfilters = [
     (r"<<(\S+)((.|\n)*?\n  > \1)", rephere),
-    (r"( *)(#([^\n]*\S)?)", repcomment),
+    (r"( +)(#([^\n]*\S)?)", repcomment),
 ]
 
 pypats = [


More information about the Mercurial-devel mailing list