Adding upstream version 3.3.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
00f36ec412
commit
05acda6fb8
7 changed files with 63 additions and 52 deletions
|
@ -16,6 +16,15 @@ EXCLUDED = frozenset((
|
|||
))
|
||||
|
||||
|
||||
def _always_run() -> frozenset[str]:
|
||||
ret = ['.github/workflows/languages.yaml', 'testing/languages']
|
||||
ret.extend(
|
||||
os.path.join('pre_commit/resources', fname)
|
||||
for fname in os.listdir('pre_commit/resources')
|
||||
)
|
||||
return frozenset(ret)
|
||||
|
||||
|
||||
def _lang_files(lang: str) -> frozenset[str]:
|
||||
prog = f'''\
|
||||
import json
|
||||
|
@ -47,10 +56,14 @@ def main() -> int:
|
|||
if fname.endswith('.py') and fname != '__init__.py'
|
||||
]
|
||||
|
||||
triggers_all = _always_run()
|
||||
for fname in triggers_all:
|
||||
assert os.path.exists(fname), fname
|
||||
|
||||
if not args.all:
|
||||
with concurrent.futures.ThreadPoolExecutor(os.cpu_count()) as exe:
|
||||
by_lang = {
|
||||
lang: files
|
||||
lang: files | triggers_all
|
||||
for lang, files in zip(langs, exe.map(_lang_files, langs))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue