check-ext: ignore pyc files

`.pyc` files could cause false positive. Scan `.py` and `.pyx` files
explicitly.

Test Plan:
Make sure `uncommit.pyc` will not break check-code but `uncommit.pyx`,
`uncommit.py` will.

Differential Revision: https://phab.mercurial-scm.org/D1283
This commit is contained in:
Jun Wu 2017-11-02 12:00:11 -07:00
parent 47b9325724
commit 09af39ffe1

View File

@ -19,7 +19,9 @@ foreignextre = re.compile(r'(%s)' % '|'.join(foreignexts))
# extensions in this repo
repoexts = set(os.path.basename(p).split('.')[0]
for p in glob('hgext3rd/*.py*') if '__' not in p)
for p in glob('hgext3rd/*.py') if '__' not in p)
repoexts.update(os.path.basename(p).split('.')[0]
for p in glob('hgext3rd/*.pyx'))
repoexts.update(os.path.basename(os.path.dirname(p))
for p in glob('hgext3rd/*/__init__.py'))
repoexts.update(os.path.basename(os.path.dirname(p))