flag-rs 0.10.0

A Cobra-inspired CLI framework with dynamic completions
Documentation
# This justfile is the single source of truth for build/test/lint.
# CI calls `just ci`. Run `just ci` locally before pushing.

# Default recipe — list available recipes
default:
    @just --list

# Format all code
fmt:
    cargo fmt --all

# Check formatting (fails if anything would be reformatted)
fmt-check:
    cargo fmt --all -- --check

# Run clippy with the project's pinned lint set. Warnings are errors.
# Three invocations: library, tests (allow unwrap/expect), examples (extra allows).
lint:
    cargo clippy --locked -- \
        -D clippy::all \
        -D clippy::pedantic \
        -D clippy::nursery \
        -D clippy::cargo \
        -D clippy::unwrap_used \
        -D clippy::expect_used \
        -A clippy::module_name_repetitions \
        -A clippy::must_use_candidate \
        -A clippy::missing_errors_doc \
        -A clippy::missing_panics_doc \
        -A clippy::missing_docs_in_private_items \
        -A clippy::missing_const_for_fn \
        -A clippy::cognitive_complexity
    cargo clippy --locked --tests -- \
        -D clippy::all \
        -D clippy::pedantic \
        -D clippy::nursery \
        -D clippy::cargo \
        -A clippy::unwrap_used \
        -A clippy::expect_used \
        -A clippy::module_name_repetitions \
        -A clippy::must_use_candidate \
        -A clippy::missing_errors_doc \
        -A clippy::missing_panics_doc \
        -A clippy::missing_docs_in_private_items \
        -A clippy::missing_const_for_fn \
        -A clippy::cognitive_complexity
    cargo clippy --locked --examples -- \
        -D clippy::all \
        -D clippy::pedantic \
        -D clippy::nursery \
        -D clippy::cargo \
        -A clippy::unwrap_used \
        -A clippy::expect_used \
        -A clippy::module_name_repetitions \
        -A clippy::must_use_candidate \
        -A clippy::missing_errors_doc \
        -A clippy::missing_panics_doc \
        -A clippy::missing_docs_in_private_items \
        -A clippy::missing_const_for_fn \
        -A clippy::cognitive_complexity \
        -A clippy::uninlined_format_args \
        -A clippy::map_unwrap_or \
        -A clippy::manual_let_else \
        -A clippy::needless_collect \
        -A clippy::single_match_else \
        -A clippy::option_if_let_else

# Run all tests (unit + integration)
test:
    cargo test --locked --workspace --all-targets

# Build the library in release mode
build:
    cargo build --locked --release

# Wipe build artifacts
clean:
    cargo clean

# Quick code stats: LOC, largest files, module tree.
# Requires `scc` (brew install scc · or · cargo install scc) and
# `cargo-modules` (cargo install cargo-modules) — both dev-only.
stats:
    @echo "=== Workspace LOC ==="
    @scc src --no-cocomo
    @echo ""
    @echo "=== Largest Rust source files (top 15) ==="
    @scc src --by-file --no-cocomo -s lines -i rs | head -20
    @echo ""
    @echo "=== Module tree ==="
    @cargo modules structure --lib 2>/dev/null \
      || echo "(install cargo-modules for the module tree: cargo install cargo-modules)"

# Run all CI checks (same as the CI workflow).
# This is what developers should run before pushing.
ci: fmt-check lint test build
    @echo "Safe to push - CI will pass."