Files
openclaw/scripts/check-swift-tools.sh
Peter Steinberger 62bd760c0e chore(swift): enforce current formatting and lint rules (#103313)
* style: apply SwiftFormat 0.62.1 rules

Refs #103202

* ci: enforce deterministic Swift lint

Refs #103202

* refactor: keep gateway connect lint-clean

Refs #103202

* style: keep iOS typography checks warning-free

* ci: route MLX Swift changes through pre-push

* fix: preserve native i18n extraction after Swift cleanup

* refactor: keep rebased Swift surfaces lint-clean

* style: format latest Swift additions

* chore: refresh native i18n inventory

* style: keep generated Swift formatter-clean

* fix: preserve node route invalidation callbacks

* fix: keep native translation IDs stable

* fix: retain native translation identifiers

* fix: preserve translations across Swift source moves
2026-07-10 11:54:08 +01:00

48 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
readonly swiftformat_version="0.62.1"
readonly swiftlint_version="0.65.0"
usage() {
echo "usage: $0 [swiftformat|swiftlint]" >&2
exit 2
}
check_tool() {
local name="$1"
local expected="$2"
local version_argument="$3"
if ! command -v "$name" >/dev/null 2>&1; then
echo "error: $name $expected is required" >&2
echo "install pinned tools with: scripts/install-swift-tools.sh .build/swift-tools" >&2
exit 1
fi
local actual
actual="$("$name" "$version_argument")"
if [[ "$actual" != "$expected" ]]; then
echo "error: expected $name $expected, found $actual" >&2
echo "install pinned tools with: scripts/install-swift-tools.sh .build/swift-tools" >&2
echo 'then prepend .build/swift-tools to PATH' >&2
exit 1
fi
}
case "$#" in
0)
check_tool swiftformat "$swiftformat_version" --version
check_tool swiftlint "$swiftlint_version" version
;;
1)
case "$1" in
swiftformat) check_tool swiftformat "$swiftformat_version" --version ;;
swiftlint) check_tool swiftlint "$swiftlint_version" version ;;
*) usage ;;
esac
;;
*) usage ;;
esac