Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 926071b

Browse files
committed
make some files trigger all languages
1 parent cf3e826 commit 926071b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

testing/languages

Lines changed: 12 additions & 1 deletion
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)