version: "3"
vars:
CARGO: cargo
FUZZ_CARGO: cargo +nightly
tasks:
default:
desc: List available tasks
cmds:
- task --list-all
fmt:
desc: Apply Rust formatting
aliases:
- fmt:fix
cmds:
- "{{.CARGO}} fmt"
fmt:check:
desc: Check Rust formatting
cmds:
- "{{.CARGO}} fmt -- --check"
check:
desc: Check the crate with default features
cmds:
- "{{.CARGO}} check"
check:all-features:
desc: Check the crate with all features
cmds:
- "{{.CARGO}} check --all-features --all-targets"
check:no-features:
desc: Check the crate without default features
cmds:
- "{{.CARGO}} check --no-default-features"
lint:
desc: Check clippy lints for all targets and features
aliases:
- lint:check
cmds:
- "{{.CARGO}} clippy --all-features --all-targets"
lint:fix:
desc: Apply clippy fixes for all targets and features
aliases:
- clippy
cmds:
- "{{.CARGO}} clippy --fix --allow-dirty --all-features --all-targets"
- task: fmt
build:
desc: Build the crate with default features
cmds:
- "{{.CARGO}} build"
test:all-features:
desc: Test the crate with all features
aliases:
- test
- test:all
cmds:
- "{{.CARGO}} test --all-features"
test:default-features:
desc: Test the crate with default features
aliases:
- test:default
cmds:
- "{{.CARGO}} test"
test:no-features:
desc: Test the crate without default features
aliases:
- test:no-default-features
cmds:
- "{{.CARGO}} test --no-default-features"
fuzz:
desc: Build fuzz targets with default fuzz features
cmds:
- "{{.FUZZ_CARGO}} fuzz list"
fuzz:build:
desc: Build fuzz targets with default fuzz features
cmds:
- "{{.FUZZ_CARGO}} fuzz build"
fuzz:build:all-features:
desc: Build fuzz targets with all fuzz feature forwards enabled
cmds:
- "{{.FUZZ_CARGO}} fuzz build --features serde,miette"
fuzz:cst:
desc: Run the CST fuzz target
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_cst"
fuzz:ast:
desc: Run the AST fuzz target
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_ast"
fuzz:hir:
desc: Run the HIR fuzz target
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_hir"
fuzz:smoke:cst:
desc: Run the CST fuzz target briefly
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_cst -- -runs=256"
fuzz:smoke:ast:
desc: Run the AST fuzz target briefly
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_ast -- -runs=256"
fuzz:smoke:hir:
desc: Run the HIR fuzz target briefly
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_hir -- -runs=256"
fuzz:smoke:all:
desc: Run all fuzz targets briefly
aliases:
- fuzz:smoke
deps:
- fuzz:smoke:cst
- fuzz:smoke:ast
- fuzz:smoke:hir
fuzz:seed:
desc: Seed fuzz corpus from test suites
cmds:
- bash fuzz/seed_corpus.sh
fuzz:dict:
desc: Generate fuzz dictionary from test suites (static; see fuzz/dictionary.txt)
cmds:
- echo "Dictionary is maintained in fuzz/dictionary.txt"
fuzz:cst:with-dict:
desc: Run the CST fuzz target with dictionary
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_cst -- -dict=fuzz/dictionary.txt"
fuzz:ast:with-dict:
desc: Run the AST fuzz target with dictionary
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_ast -- -dict=fuzz/dictionary.txt"
fuzz:hir:with-dict:
desc: Run the HIR fuzz target with dictionary
cmds:
- "{{.FUZZ_CARGO}} fuzz run fuzz_parse_hir -- -dict=fuzz/dictionary.txt"
verify:
desc: Run formatting checks, static checks, clippy, and the test matrix
deps:
- fmt:check
- check:all-features
- check:no-features
- lint:check
- test
- test:all-features
- test:no-features
clean:
desc: Remove Cargo build artifacts
cmds:
- "{{.CARGO}} clean"