ctl-core 0.6.13

Shared clap chassis for the *ctl CLIs
Documentation
# The standard Rust tasks every ctl repository runs. A repository includes
# this file at a pinned ctl-core release, after any other includes:
#
#   [settings]
#   experimental = true  # mise loads git:: task includes only with this on
#
#   [task_config]
#   includes = [
#     "git::https://github.com/victor-software-house/ctl-core.git//tasks/rust.toml?ref=v0.6.13",
#   ]
#
# The repository defines `check:features` itself, which `verify` depends on.
# Its mise.dev.toml pins the tools these tasks call, including the stable
# compiler and the formatting nightly named in `format`. Bump the ref and
# those pins together.

["check:toolchain"]
description = "mise.dev.toml, rust-toolchain.toml, and rust-version pin the same stable"
# pipefail: a failing cargo metadata or jq must fail the task, not pass it.
shell = "bash -o pipefail -c"
run = [
  '[ "$(rustc -V)" = "$(env -u RUSTUP_TOOLCHAIN RUSTUP_AUTO_INSTALL=0 rustc -V)" ] || { echo "✘ mise.dev.toml and rust-toolchain.toml pin different toolchains"; exit 1; }',
  '''cargo metadata --no-deps --format-version 1 | jq --arg v "$(rustc -V | cut -d' ' -f2)" '[.packages[] | select(.rust_version != $v) | .name] | if length > 0 then error("✘ rust-version differs from the pinned stable in: \(join(", "))") else empty end' ''',
]

[format]
description = "rustfmt check on the formatting nightly"
run = "cargo +nightly-2026-09-29 fmt --all -- --check"

[lint]
description = "clippy -D warnings"
run = "cargo clippy --all-targets --all-features -- -D warnings"

[test]
description = "Unit and integration tests"
run = "cargo test --all-features --lib --bins --tests"
# Stops a hung test run instead of holding the gate. The limit also counts
# compile time and waits on the target/ lock, so it sits far above a cold build.
timeout = "30m"

["test:doc"]
description = "Doc-tests"
run = "cargo test --doc --all-features"
timeout = "30m"

[deny]
description = "License, ban, and source policy (offline)"
run = "cargo deny check licenses bans sources"

["deny:advisories"]
description = "RustSec advisories and yanked crates (network)"
run = "cargo deny check advisories"

[deps]
description = "Unused crate analysis"
run = "cargo-machete --with-metadata"

# Published crates only. CI runs it before packaging; it compares against the
# release on crates.io.
[semver]
description = "Public API changes against the last release (network)"
run = "cargo semver-checks"

[verify]
description = "Toolchain pins, format, lint, feature sets, tests, doc-tests, deny, unused crates"
depends = [
  "check:toolchain", "format", "lint", "check:features",
  "test", "test:doc", "deny", "deps",
]