alias r := run
alias t := test
alias rr := run-release
alias f := fmt
alias l := lint
alias d := doc
alias b := build
alias br := build-release
alias uf := update-flake-dependencies
alias uc := update-cargo-dependencies
alias w := cargo-watch

test:
    #cargo test -- --include-ignored
    bat Cargo.lock | ./target/debug/alternate
rtest:
    cat Cargo.lock | ./target/release/alternate

run:
    cargo run

fmt:
    cargo fmt
    treefmt --config-file .treefmt.toml --tree-root ./.

build:
    cargo build

lint:
    cargo clippy
    nix run nixpkgs#typos
    cargo udeps
    lychee README.md

doc:
    cargo doc --open --offline --document-private-items

run-release:
    cargo run --release
build-release:
    cargo build --release

update-flake-dependencies:
    nix flake update --commit-lock-file

# Update and then commit the `Cargo.lock` file
update-cargo-dependencies:
    cargo update
    git add Cargo.lock
    git commit Cargo.lock -m "update(cargo): \`Cargo.lock\`"

error:
    export RUST_LOG=error

info:
    export RUST_LOG=info

debug:
    export RUST_LOG=debug

cargo-watch:
    cargo watch -x check -x test -x build
