check-code: move fixing up regexp into main procedure
This patch makes an extra check pattern to be prepared by
"_preparepats()" as similarly as existing patterns, if it is added to
"checks" array before invocation of "main()" in check-code.py.
This is a part of preparation for adding check-code.py extra checks by
another python script in subsequent patch.
This is also useful for SkeletonExtensionPlan.
https://www.mercurial-scm.org/wiki/SkeletonExtensionPlan
--- a/contrib/check-code.py Fri May 20 09:47:35 2016 +0900
+++ b/contrib/check-code.py Fri May 20 09:47:35 2016 +0900
@@ -474,7 +474,6 @@
filters = c[3]
for i, flt in enumerate(filters):
filters[i] = re.compile(flt[0]), flt[1]
-_preparepats()
class norepeatlogger(object):
def __init__(self):
@@ -644,6 +643,8 @@
else:
check = args
+ _preparepats()
+
ret = 0
for f in check:
if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,