#!/bin/bash
# Quick quality check (5 minutes)
# Run before pushing code

set -e

echo "🔍 Running quick quality checks..."
echo

# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color

# Function to print status
status() {
    if [ $1 -eq 0 ]; then
        echo -e "${GREEN}✓ $2${NC}"
    else
        echo -e "${RED}✗ $2${NC}"
        exit 1
    fi
}

echo "📦 Type-checking..."
pnpm typecheck
status $? "Type-check passed"

echo
echo "🔧 Linting..."
pnpm lint
status $? "Linting passed"

echo
echo "📝 Checking formatting..."
pnpm format:check
status $? "Formatting check passed"

echo
echo "🧪 Running tests..."
pnpm test
status $? "Tests passed"

echo
echo -e "${GREEN}✅ All checks passed! Safe to push.${NC}"
