[tools]
"rust" = { version = "nightly", profile = "default", components = "rust-src,llvm-tools,rustfmt,rust-std,cargo,clippy" }
cargo = "latest"
"cargo:cargo-nextest" = "latest"
taplo = "latest"

[tasks.'check:fmt']
description = "Check code formatting"
run = 'cargo fmt --all -- --check'

[tasks.'check:clippy']
description = "Check for lints"
run = 'cargo clippy --all --workspace --all-features -- -D warnings'

[tasks.'check:test:nextest']
env = { RUST_BACKTRACE = "1" }
description = "Run tests with nextest"
run = 'cargo nextest run --all-features --workspace --examples --bins --lib'

[tasks.'check:test:docs']
description = "Test code examples in documentation"
run = 'cargo test --doc --all-features --workspace'

[tasks.'check:taplo:lint']
description = "Check TOML files formatting"
run = 'taplo lint $(git ls-files "*.toml")'

[tasks.'check:taplo:format']
description = "Format TOML files"
run = 'taplo format --check $(git ls-files "*.toml")'

[tasks.check]
description = "Run all checks"
depends = ['check:*']

[tasks.'fix:taplo:format']
description = "Format TOML files"
run = 'taplo format $(git ls-files "*.toml")'

[tasks.'fix:clippy']
description = "Fix lints"
run = 'cargo clippy --all --all-targets --all-features --fix --allow-dirty -- -D warnings'

[tasks.'fix:fmt']
description = "Format code"
run = 'cargo fmt --all'

[tasks.fix]
description = "Run all fixers"
depends = ['fix:*']
