[tools]
rust = "1.94.0"
"cargo:cargo-insta" = "1.45.1"
lefthook = "1.10.10"

[tasks.build]
description = "Build the project"
run = "cargo build -q"
sources = ["Cargo.toml", "src/**/*.rs"]

[tasks."build:release"]
description = "Build release binary"
run = "cargo build --release -q"

[tasks.fmt]
description = "Format code"
run = "cargo fmt"

[tasks.clippy]
description = "Run lints"
run = "cargo clippy -q --all-targets --features test-support -- -D warnings"

[tasks."clippy:fix"]
description = "Auto-fix clippy warnings"
run = "cargo clippy --all-targets --features test-support --fix --allow-dirty --allow-staged"

[tasks.test]
description = "Run tests"
run = "cargo test -q --features test-support"

[tasks."test:debug"]
description = "Run specific test with output (e.g., mise run test:debug test_name)"
run = "cargo test $1 --features test-support -- --nocapture"

[tasks."test:ignored"]
description = "Run #[ignore] integration tests (requires PostgreSQL)"
run = "cargo test --features test-support -- --ignored"

[tasks.run]
description = "Run application"
run = "cargo run"

[tasks.dev]
description = "Run with profile"
run = "cargo run -- -p ${1:-default}"

[tasks.pre-commit]
description = "Pre-commit checks"
depends = ["fmt-check", "clippy", "check", "test"]
