[PATCH 3 of 5 V3] check-code: move fixing up regexp into main procedure

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Jul 15 11:29:43 EDT 2016

# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1463705255 -32400
#      Fri May 20 09:47:35 2016 +0900
# Node ID 58e094219484a69088a7b1c93251dc2fc31f7cda
# Parent  4fa5a7fa43ebab4170fdbd754c8adf92519881b9
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.


diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -473,7 +473,6 @@ def _preparepats():
         filters = c[3]
         for i, flt in enumerate(filters):
             filters[i] = re.compile(flt[0]), flt[1]
 class norepeatlogger(object):
     def __init__(self):
@@ -643,6 +642,8 @@ def main():
         check = args
+    _preparepats()
     ret = 0
     for f in check:
         if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,

More information about the Mercurial-devel mailing list