#!/usr/bin/env bash
set -euo pipefail

repo_root=$(git rev-parse --show-toplevel)

(
  cd "$repo_root/tooling/lints"
  cargo fmt --check
  cargo clippy --locked --all-targets -- -D warnings
  cargo nextest run --locked --release --all-targets --no-fail-fast
  cargo doc --locked --no-deps --document-private-items
  cargo dylint --path . -- --locked --all-targets
)

cd "$repo_root"
cargo dylint --all -- --locked --workspace --all-targets
cargo fmt --all --check
cargo clippy --locked --workspace --all-targets -- -D warnings
INSTA_UPDATE=no cargo nextest run --locked --workspace --release --no-fail-fast
cargo test --locked --workspace --doc --release
