clapfig 0.16.0

Rich, layered configuration for Rust CLI apps
Documentation
#!/bin/bash
set -e

echo "🔧 Running pre-commit checks..."

# Get list of staged Rust files
STAGED_RS_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.rs$' || true)

if [ -n "$STAGED_RS_FILES" ]; then
    # Auto-format and re-stage
    echo "📝 Running cargo fmt..."
    cargo fmt --all
    for file in $STAGED_RS_FILES; do
        [ -f "$file" ] && git add "$file"
    done

    # Auto-fix clippy and re-stage
    echo "📎 Running cargo clippy --fix..."
    cargo clippy --fix --allow-dirty --allow-staged --all-targets 2>&1 || true
    for file in $STAGED_RS_FILES; do
        [ -f "$file" ] && git add "$file"
    done
fi

# Run the same checks CI uses
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
exec "$SCRIPT_DIR/check"