arlo 0.1.0

P2P-based RPC URL discovery for Ethereum and Base networks
# Arlo Justfile
# P2P-based RPC URL discovery for Ethereum and Base networks

alias t := test
alias f := fix
alias b := build
alias c := clean
alias u := check-udeps
alias wt := watch-test
alias wc := watch-check

# Default to display help menu
default:
    @just --list --list-submodules

# Run all CI checks
ci: fix check

# Run all checks (format, clippy, test, deny)
check: check-format check-clippy test check-deny

# Fix formatting and clippy issues
fix: format-fix clippy-fix

# Install cargo-nextest if not present
install-nextest:
    @command -v cargo-nextest >/dev/null 2>&1 || cargo install cargo-nextest

# Run tests
test: install-nextest
    RUSTFLAGS="-D warnings" cargo nextest run --all-features

# Build in release mode
build:
    cargo build --release

# Build in debug mode
build-debug:
    cargo build

# Build with maximum performance profile
build-maxperf:
    cargo build --profile maxperf

# Clean build artifacts
clean:
    cargo clean

# Check formatting
check-format:
    cargo +nightly fmt --all -- --check

# Fix formatting issues
format-fix:
    cargo +nightly fmt --all

# Check clippy lints
check-clippy:
    RUSTFLAGS="-D warnings" cargo clippy --all-features --all-targets -- -D warnings

# Fix clippy issues
clippy-fix:
    cargo clippy --all-features --all-targets --fix --allow-dirty --allow-staged

# Check for unused dependencies
check-udeps:
    @command -v cargo-udeps >/dev/null 2>&1 || cargo install cargo-udeps
    cargo +nightly udeps --all-features

# Check dependencies with cargo-deny
check-deny:
    @command -v cargo-deny >/dev/null 2>&1 || cargo install cargo-deny
    cargo deny check

# Perform lychee link checks, installing lychee if necessary
lychee:
    @command -v lychee >/dev/null 2>&1 || cargo install lychee
    lychee --config ./lychee.toml .

# Run documentation tests
doc-test:
    cargo test --doc --all-features

# Build documentation
doc:
    cargo doc --all-features --no-deps

# Watch for changes and run tests
watch-test:
    cargo watch -x 'nextest run --all-features'

# Watch for changes and run check
watch-check:
    cargo watch -x 'check --all-features'

# Run the arlo binary
run *args:
    cargo run --release -- {{args}}

# Run the arlo binary
arlo *args:
    cargo run --release -- {{args}}