Development tasks for rustic.
You can run this file with mask.
Install mask with cargo install mask.
Checks the library for syntax and HIR errors.
Bash:
cargo check --no-default-features \
&& cargo check --all-featuresPowerShell:
[Diagnostics.Process]::Start("cargo", "check --no-default-features").WaitForExit()
[Diagnostics.Process]::Start("cargo", "cargo check --all-features").WaitForExit()Continually runs the development routines.
Bash:
mask loop devPowerShell:
[Diagnostics.Process]::Start("mask", "loop dev").WaitForExit()Removes all build artifacts.
Bash:
cargo cleanPowerShell:
[Diagnostics.Process]::Start("cargo", "clean").WaitForExit()Runs the completion generator and tests
Regenerates the completion fixtures for all shells
IMPORTANT: Only run on Bash for test compatibility.
cargo run -- completions powershell > tests/completions-fixtures/powershell.txt \
&& cargo run -- completions bash > tests/completions-fixtures/bash.txt \
&& cargo run -- completions fish > tests/completions-fixtures/fish.txt \
&& cargo run -- completions zsh > tests/completions-fixtures/zsh.txtTest the completions for breaking changes
cargo test -r --all-targets --all-features --workspace -- --ignoredRuns the development routines
Bash:
$MASK format \
&& $MASK lint \
&& $MASK test \
&& $MASK docPowerShell:
[Diagnostics.Process]::Start("mask", "format").WaitForExit()
[Diagnostics.Process]::Start("mask", "lint").WaitForExit()
[Diagnostics.Process]::Start("mask", "test").WaitForExit()
[Diagnostics.Process]::Start("mask", "doc").WaitForExit()Opens the crate documentation
Bash:
cargo doc --all-features --no-deps --open $cratePowerShell:
[Diagnostics.Process]::Start("cargo", "doc --all-features --no-deps --open $crate").WaitForExit()Run formatters on the repository.
Runs the formatter on all Rust files.
Bash:
cargo fmt --allPowerShell:
[Diagnostics.Process]::Start("cargo", "fmt --all").WaitForExit()Runs the formatter on md, json, and toml files
Bash:
dprint fmtPowerShell:
[Diagnostics.Process]::Start("dprint", "fmt").WaitForExit()Runs all the formatters.
Bash:
$MASK format cargo \
&& $MASK format dprintPowerShell:
[Diagnostics.Process]::Start("mask", "format cargo").WaitForExit()
[Diagnostics.Process]::Start("mask", "format dprint").WaitForExit()Lists all crates that depend on the given crate
Bash:
cargo tree -e features -i $cratePowerShell:
[Diagnostics.Process]::Start("cargo", "tree -e features -i $crate").WaitForExit()Runs the linter
Bash:
$MASK check \
&& cargo clippy --no-default-features -- -D warnings \
&& cargo clippy --all-features -- -D warningsPowerShell:
[Diagnostics.Process]::Start("mask", "check").WaitForExit()
[Diagnostics.Process]::Start("cargo", "clippy --no-default-features -- -D warnings").WaitForExit()
[Diagnostics.Process]::Start("cargo", "clippy --all-features -- -D warnings").WaitForExit()Continually runs some recipe from this file.
Bash:
watchexec -w src -- "$MASK $action"PowerShell:
[Diagnostics.Process]::Start("watchexec", "-w src -- $MASK $action).WaitForExit()Looks for undefined behavior in the (non-doc) test suite.
NOTE: This requires the nightly toolchain.
Bash:
cargo +nightly miri test --all-features -q --lib --tests $testsPowerShell:
[Diagnostics.Process]::Start("cargo", "+nightly miri test --all-features -q --lib --tests $tests").WaitForExit()Runs the whole test suite with nextest.
Runs the whole test suite with nextest on the workspace, including ignored tests.
Bash:
cargo nextest run -r --all-features --workspace -- --ignoredPowerShell:
[Diagnostics.Process]::Start("cargo", "nextest run -r --all-features --workspace -- --ignored").WaitForExit()Runs the whole test suite with nextest on the workspace.
Bash:
cargo nextest run -r --all-features --workspacePowerShell:
[Diagnostics.Process]::Start("cargo", "nextest run -r --all-features --workspace").WaitForExit()Runs a single test with nextest.
- test
- flags: -t, --test
- type: string
- desc: Only run the specified test target
- required
Bash:
cargo nextest run -r --all-features -E "test($test)"PowerShell:
[Diagnostics.Process]::Start("cargo", "nextest run -r --all-features -E 'test($test)'").WaitForExit()Prepare a Contribution/Pull request and run necessary checks and lints
Bash:
$MASK fmt \
&& $MASK test \
&& $MASK lintPowerShell:
[Diagnostics.Process]::Start("mask", "fmt").WaitForExit()
[Diagnostics.Process]::Start("mask", "test").WaitForExit()
[Diagnostics.Process]::Start("mask", "lint").WaitForExit()Runs a test to check if the public api of
rustic_corehas been changed
Regenerates the fixtures for the public api test
Bash:
UPDATE_EXPECT=1; cargo test --test public_api -p rustic_core -- --ignoredPowerShell:
$env:UPDATE_EXPECT=1; [Diagnostics.Process]::Start("cargo", "test --test public_api -p rustic_core -- --ignored").WaitForExit()Runs the public api test
Bash:
cargo test --test public_api -p rustic_core -- --ignoredPowerShell:
[Diagnostics.Process]::Start("cargo", "test --test public_api -p rustic_core -- --ignored").WaitForExit()Runs the test suites.
Bash:
$MASK check \
&& $MASK lint
&& cargo test --all-featuresPowerShell:
[Diagnostics.Process]::Start("mask", "check").WaitForExit()
[Diagnostics.Process]::Start("mask", "lint").WaitForExit()
[Diagnostics.Process]::Start("cargo", "test --all-features").WaitForExit()