blob: b011d361f9e6d49d191d7fdadc9e06562b687329 [file]
#!/usr/bin/env bash
#
# Copyright 2026 The Fuchsia Authors
#
# Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
# <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
# license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.
set -euo pipefail
TIMEOUT_SECS=1800
if [[ -z "${CI_SCRIPT_TIMEOUT_ACTIVE:-}" ]]; then
echo "$0: limit ${TIMEOUT_SECS}s; exit 124 or 137 means it timed out" >&2
export CI_SCRIPT_TIMEOUT_ACTIVE=1
exec /usr/bin/timeout --verbose --kill-after=120s "${TIMEOUT_SECS}s" \
"$BASH" "$0" "$@"
fi
unset CI_SCRIPT_TIMEOUT_ACTIVE
: "${FMT_DOMAIN:?}"
NIGHTLY="${PIN_RUST_TOOLCHAINS__NIGHTLY:?}"
case "$FMT_DOMAIN" in
tools)
for manifest in \
tools/anneal-cpp/Cargo.toml \
tools/anneal-mir-eval/Cargo.toml \
tools/anneal-scaffold/Cargo.toml \
tools/anneal-spec/Cargo.toml; do
cargo +"$NIGHTLY" fmt --manifest-path "$manifest" --all --check >&2
done
;;
exocrate)
cargo +"$NIGHTLY" fmt --manifest-path crates/exocrate/Cargo.toml --check >&2
;;
*)
echo "error: unknown FMT_DOMAIN: $FMT_DOMAIN" >&2
exit 1
;;
esac