1
0
Fork 0

Adding upstream version 3.3.2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:42:32 +01:00
parent 00f36ec412
commit 05acda6fb8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
7 changed files with 63 additions and 52 deletions

View file

@ -1,29 +0,0 @@
#!/usr/bin/env bash
# This is a script used in CI to install swift
set -euo pipefail
. /etc/lsb-release
if [ "$DISTRIB_CODENAME" = "jammy" ]; then
SWIFT_URL='https://download.swift.org/swift-5.7.1-release/ubuntu2204/swift-5.7.1-RELEASE/swift-5.7.1-RELEASE-ubuntu22.04.tar.gz'
SWIFT_HASH='7f60291f5088d3e77b0c2364beaabd29616ee7b37260b7b06bdbeb891a7fe161'
else
echo "unknown dist: ${DISTRIB_CODENAME}" 1>&2
exit 1
fi
check() {
echo "$SWIFT_HASH $TGZ" | sha256sum --check
}
TGZ="$HOME/.swift/swift.tar.gz"
mkdir -p "$(dirname "$TGZ")"
if ! check >& /dev/null; then
rm -f "$TGZ"
curl --location --silent --output "$TGZ" "$SWIFT_URL"
check
fi
mkdir -p /tmp/swift
tar -xf "$TGZ" --strip 1 --directory /tmp/swift
echo '/tmp/swift/usr/bin' >> "$GITHUB_PATH"

View file

@ -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))
}