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

login
register
mail settings
Submitter Augie Fackler
Date July 12, 2016, 7:49 p.m.
Message ID <22e0c03114ed488eb162.1468352990@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/15809/
State Accepted
Headers show

Comments

Augie Fackler - July 12, 2016, 7:49 p.m.
# HG changeset patch
# User Augie Fackler <augie@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.

Patch

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 = [