Mercurial > public > mercurial-scm > hg-stable
comparison contrib/check-code.py @ 29569:3d52e7c78a6b
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
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 20 May 2016 09:47:35 +0900 |
parents | 7825f6154a65 |
children | 24991e7f775f |
comparison
equal
deleted
inserted
replaced
29568:7825f6154a65 | 29569:3d52e7c78a6b |
---|---|
472 | 472 |
473 pats[i] = (re.compile(p, re.MULTILINE),) + pseq[1:] | 473 pats[i] = (re.compile(p, re.MULTILINE),) + pseq[1:] |
474 filters = c[3] | 474 filters = c[3] |
475 for i, flt in enumerate(filters): | 475 for i, flt in enumerate(filters): |
476 filters[i] = re.compile(flt[0]), flt[1] | 476 filters[i] = re.compile(flt[0]), flt[1] |
477 _preparepats() | |
478 | 477 |
479 class norepeatlogger(object): | 478 class norepeatlogger(object): |
480 def __init__(self): | 479 def __init__(self): |
481 self._lastseen = None | 480 self._lastseen = None |
482 | 481 |
642 if len(args) == 0: | 641 if len(args) == 0: |
643 check = glob.glob("*") | 642 check = glob.glob("*") |
644 else: | 643 else: |
645 check = args | 644 check = args |
646 | 645 |
646 _preparepats() | |
647 | |
647 ret = 0 | 648 ret = 0 |
648 for f in check: | 649 for f in check: |
649 if not checkfile(f, maxerr=options.per_file, warnings=options.warnings, | 650 if not checkfile(f, maxerr=options.per_file, warnings=options.warnings, |
650 blame=options.blame, debug=options.debug, | 651 blame=options.blame, debug=options.debug, |
651 lineno=options.lineno): | 652 lineno=options.lineno): |