mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 10:04:55 +08:00
fix(release): 完成分发证明代际绑定与质量门禁收口
This commit is contained in:
+1
-27
@@ -20,34 +20,8 @@ run_required() {
|
||||
printf 'PASS required: %s\n' "${name}"
|
||||
}
|
||||
|
||||
check_gofmt() {
|
||||
local -a go_dirs=()
|
||||
local -a go_files=()
|
||||
local dir file formatted dirs_file
|
||||
dirs_file="$(mktemp)"
|
||||
if ! go list -f '{{.Dir}}' ./... >"${dirs_file}"; then
|
||||
rm -f "${dirs_file}"
|
||||
return 1
|
||||
fi
|
||||
mapfile -t go_dirs <"${dirs_file}"
|
||||
rm -f "${dirs_file}"
|
||||
for dir in "${go_dirs[@]}"; do
|
||||
for file in "${dir}"/*.go; do
|
||||
[[ -f "${file}" ]] && go_files+=("${file}")
|
||||
done
|
||||
done
|
||||
if ((${#go_files[@]} == 0)); then
|
||||
return
|
||||
fi
|
||||
formatted="$(gofmt -l "${go_files[@]}")"
|
||||
if [[ -n "${formatted}" ]]; then
|
||||
printf 'gofmt required; files need formatting:\n%s\n' "${formatted}" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_required "Rust formatting" cargo fmt --all -- --check
|
||||
run_required "Go formatting" check_gofmt
|
||||
run_required "Go formatting" make check-go-format
|
||||
run_required "Rust check" cargo check --workspace --locked
|
||||
run_required "Rust release build" cargo build --workspace --release --locked
|
||||
run_required "Rust clippy" cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||
|
||||
Reference in New Issue
Block a user