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

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

echo "Running cargo fmt --all..."
cargo fmt --all

echo "Running cargo clippy --fix --allow-dirty --allow-staged --all-targets --all-features..."
cargo clippy --fix --allow-dirty --allow-staged --all-targets --all-features

echo "pre-commit formatting and linting complete."
