#!/usr/bin/env bash

# This script runs clippy with the most common configurations.
# Arguments given will be passed through to "cargo clippy"

set -euo pipefail

# Source common functions for logging
SCRIPT_DIR=$(cd $(dirname $0);pwd)
source "${SCRIPT_DIR}/common.sh"

main() {
    log "Running clippy with all targets..."
    
    cd "${PROJECT_ROOT}"
    
    # Run clippy using the clippy script
    if "${SCRIPT_DIR}/clippy" --all-targets "$@"; then
        log "Clippy check completed successfully! ✓"
        exit 0
    else
        log_error "Clippy check failed"
        exit 1
    fi
}

# Execute main function
main "$@"
