comparison contrib/check-code.py @ 22101:6fa40bd78bc8

check-code: allow an escape pattern to be specified for testpattern Before this patch it was impossible to introduce a #no-xxx comment to disable a test pattern warning.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 02 Aug 2014 17:04:53 -0700
parents efd5b7eb3e6d
children 2965804483e3
comparison
equal deleted inserted replaced
22100:efd5b7eb3e6d 22101:6fa40bd78bc8
177 "glob match with no glob character (?*/)"), 177 "glob match with no glob character (?*/)"),
178 ] 178 ]
179 ] 179 ]
180 180
181 for i in [0, 1]: 181 for i in [0, 1]:
182 for p, m in testpats[i]: 182 for tp in testpats[i]:
183 p = tp[0]
184 m = tp[1]
183 if p.startswith(r'^'): 185 if p.startswith(r'^'):
184 p = r"^ [$>] (%s)" % p[1:] 186 p = r"^ [$>] (%s)" % p[1:]
185 else: 187 else:
186 p = r"^ [$>] .*(%s)" % p 188 p = r"^ [$>] .*(%s)" % p
187 utestpats[i].append((p, m)) 189 utestpats[i].append((p, m) + tp[2:])
188 190
189 utestfilters = [ 191 utestfilters = [
190 (r"<<(\S+)((.|\n)*?\n > \1)", rephere), 192 (r"<<(\S+)((.|\n)*?\n > \1)", rephere),
191 (r"( *)(#([^\n]*\S)?)", repcomment), 193 (r"( *)(#([^\n]*\S)?)", repcomment),
192 ] 194 ]