Skip to content

Commit ee49d42

Browse files
authored
Merge pull request pre-commit#2882 from pre-commit/languages-always-run
make some files trigger all languages
2 parents 0deb445 + 926071b commit ee49d42

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

testing/languages

+12-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ EXCLUDED = frozenset((
1616
))
1717

1818

19+
def _always_run() -> frozenset[str]:
20+
ret = ['.github/workflows/languages.yml', 'testing/languages']
21+
ret.extend(
22+
os.path.join('pre_commit/resources', fname)
23+
for fname in os.listdir('pre_commit/resources')
24+
)
25+
return frozenset(ret)
26+
27+
1928
def _lang_files(lang: str) -> frozenset[str]:
2029
prog = f'''\
2130
import json
@@ -47,10 +56,12 @@ def main() -> int:
4756
if fname.endswith('.py') and fname != '__init__.py'
4857
]
4958

59+
triggers_all = _always_run()
60+
5061
if not args.all:
5162
with concurrent.futures.ThreadPoolExecutor(os.cpu_count()) as exe:
5263
by_lang = {
53-
lang: files
64+
lang: files | triggers_all
5465
for lang, files in zip(langs, exe.map(_lang_files, langs))
5566
}
5667

0 commit comments

Comments
 (0)