zed/script/clippy
Finn Evers 14358b711c
ci: Add check for protobuf formatting (#50418)
This adds more checks for the protobuf files to CI

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-03-01 13:18:09 +01:00

23 lines
606 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
if [[ ! " $* " == *" -p "* && ! " $* " == *" --package "* ]]; then
set -- "$@" --workspace
fi
set -x
"${CARGO:-cargo}" clippy "$@" --release --all-targets --all-features -- --deny warnings
# If local, run other checks if we have the tools installed.
if [[ -z "${GITHUB_ACTIONS+x}" ]]; then
which cargo-machete >/dev/null 2>&1 || exit 0
cargo machete
which typos >/dev/null 2>&1 || exit 0
typos --config typos.toml
which buf >/dev/null 2>&1 || exit 0
buf lint crates/proto/proto
buf format --diff --exit-code crates/proto/proto
fi