#!/bin/bash
# Quick validation - runs fast checks only (no tests or release build)
# Use this during development for fast feedback

set -e

# Change to project root (parent of scripts directory)
cd "$(dirname "$0")/.."

echo "⚡ Running quick validation..."
echo ""

GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m'

print_status() {
    if [ $? -eq 0 ]; then
        echo -e "${GREEN}✓${NC} $1"
    else
        echo -e "${RED}✗${NC} $1"
        exit 1
    fi
}

# 1. Check formatting
echo -e "${YELLOW}[1/2]${NC} Checking code formatting..."
cargo fmt --all -- --check
print_status "Code formatting"
echo ""

# 2. Run Clippy
echo -e "${YELLOW}[2/2]${NC} Running Clippy lints..."
cargo clippy --all-targets --all-features -- -D warnings
print_status "Clippy checks"
echo ""

echo -e "${GREEN}✓ Quick checks passed!${NC}"
echo "Run ./scripts/validate.sh for full validation before committing."
