# audio.mbt task bundle. The substance of every gate is a moon
# subcommand; just only ties them together.

# Type-check everything, treating warnings as errors
check:
    moon check --deny-warn --target all

# Format all sources
fmt:
    moon fmt

# Check formatting without changing files
fmt-check:
    moon fmt --check

# Run all tests on every target
test:
    moon test --target native
    moon test --target wasm
    moon test --target wasm-gc
    moon test --target js

# Run tests and report any uncovered lines (must be none)
coverage:
    moon coverage clean
    moon test
    moon coverage analyze

# Run benchmarks (native target)
bench:
    moon bench --target native

# Run formal verification (moon prove) for the proof-enabled
# packages. Goes through `mise x` so that Why3 invokes the real
# Z3 binary from the mise install instead of the shim.
prove:
    mise x -- moon prove sample
    mise x -- moon prove ringbuffer

# Regenerate package interface files
info:
    moon info

# Verify the generated interface files are unchanged
info-check: info
    git diff --exit-code -- ':(glob)**/pkg.generated.mbti'

# Everything CI runs
ci: fmt-check check test coverage prove info-check

# Everything that must pass before a release or publication:
# the full gate set, run locally (same as CI)
release-check: ci
