#!/usr/bin/env bash

set -e

# @cmd Check outdated deps
outdated() {
    cargo outdated --root-deps-only $@
}

# @cmd Test all crates and modules
# @alias t
test() {
    cargo test --all
}

# @cmd Format/clippy code
fmt() {
    cargo clippy --all --all-targets
    cargo fmt --all
}

# @cmd Run before commit
# @alias pc
commit@pre() {
    fmt
    outdated --exit-code 1
    test
}

eval $(argc --argc-eval "$0" "$@")
