chore(ci): align lint gate and add strict audit path (#410)

This commit is contained in:
Chummy 2026-02-17 01:36:17 +08:00 committed by GitHub
parent 74c0c7340b
commit b161fff9ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 10 deletions

View file

@ -7,18 +7,26 @@
set -euo pipefail
echo "==> pre-push: checking formatting..."
cargo fmt -- --check || {
echo "FAIL: cargo fmt -- --check found unformatted code."
cargo fmt --all -- --check || {
echo "FAIL: cargo fmt --all -- --check found unformatted code."
echo "Run 'cargo fmt' and try again."
exit 1
}
echo "==> pre-push: running clippy..."
cargo clippy -- -D warnings || {
echo "FAIL: clippy reported warnings."
cargo clippy --all-targets -- -D clippy::correctness || {
echo "FAIL: clippy correctness gate reported issues."
exit 1
}
if [ "${ZEROCLAW_STRICT_LINT:-0}" = "1" ]; then
echo "==> pre-push: running strict clippy warnings gate (ZEROCLAW_STRICT_LINT=1)..."
cargo clippy --all-targets -- -D warnings || {
echo "FAIL: strict clippy warnings gate reported issues."
exit 1
}
fi
echo "==> pre-push: running tests..."
cargo test || {
echo "FAIL: some tests did not pass."