| 1 |
_list: |
| 2 |
@just --list |
| 3 |
|
| 4 |
toolchain := "" |
| 5 |
msrv := ``` |
| 6 |
cargo metadata --format-version=1 \ |
| 7 |
| jq -r 'first(.packages[] | select(.source == null and .rust_version)) | .rust_version' \ |
| 8 |
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/' |
| 9 |
``` |
| 10 |
msrv_rustup := "+" + msrv |
| 11 |
|
| 12 |
# Check project. |
| 13 |
[group("lint")] |
| 14 |
check: && clippy |
| 15 |
just --unstable --fmt --check |
| 16 |
# fd --hidden -e=toml --exec-batch taplo format --check |
| 17 |
# fd --hidden -e=toml --exec-batch taplo lint |
| 18 |
# fd --hidden --type=file -e=md -e=yml --exec-batch prettier --check |
| 19 |
cargo +nightly fmt -- --check |
| 20 |
|
| 21 |
# Format project. |
| 22 |
[group("lint")] |
| 23 |
fmt: |
| 24 |
just --unstable --fmt |
| 25 |
# fd --hidden -e=toml --exec-batch taplo format |
| 26 |
# fd --hidden --type=file -e=md -e=yml --exec-batch prettier --write |
| 27 |
cargo +nightly fmt |
| 28 |
|
| 29 |
# Update READMEs from crate root documentation. |
| 30 |
[group("lint")] |
| 31 |
update-readme: |
| 32 |
cargo rdme --force |
| 33 |
npx -y prettier --write README.md |
| 34 |
|
| 35 |
# Lint workspace with Clippy. |
| 36 |
[group("lint")] |
| 37 |
clippy: |
| 38 |
cargo clippy --workspace --all-targets --no-default-features |
| 39 |
cargo clippy --workspace --all-targets --all-features |
| 40 |
|
| 41 |
# Test workspace. |
| 42 |
[group("test")] |
| 43 |
test: |
| 44 |
cargo {{ toolchain }} nextest run --workspace --no-default-features |
| 45 |
cargo {{ toolchain }} nextest run --workspace --all-features |
| 46 |
cargo {{ toolchain }} test --doc --workspace --all-features |
| 47 |
RUSTDOCFLAGS="-D warnings" cargo {{ toolchain }} doc --workspace --no-deps --all-features |
| 48 |
|
| 49 |
# Downgrade dev-dependencies necessary to run MSRV checks/tests. |
| 50 |
[private] |
| 51 |
downgrade-for-msrv: |
| 52 |
# No downgrades currently necessary. |
| 53 |
# cargo update -p=foo --precise=x.y.z # next ver: 1.XX |
| 54 |
|
| 55 |
# Test workspace using MSRV. |
| 56 |
[group("test")] |
| 57 |
test-msrv: |
| 58 |
@just toolchain={{ msrv_rustup }} downgrade-for-msrv |
| 59 |
@just toolchain={{ msrv_rustup }} test |
| 60 |
|
| 61 |
# Test workspace and generate Codecov coverage file |
| 62 |
[group("test")] |
| 63 |
test-coverage-codecov: |
| 64 |
cargo {{ toolchain }} llvm-cov --workspace --all-features --codecov --output-path codecov.json |
| 65 |
|
| 66 |
# Test workspace and generate LCOV coverage file |
| 67 |
[group("test")] |
| 68 |
test-coverage-lcov: |
| 69 |
cargo {{ toolchain }} llvm-cov --workspace --all-features --lcov --output-path lcov.info |
| 70 |
|
| 71 |
# Build crate for a no-std target. |
| 72 |
build-no-std: |
| 73 |
cargo build --target=thumbv6m-none-eabi --manifest-path=./ensure-no-std/Cargo.toml |
| 74 |
|
| 75 |
# Document crates in workspace. |
| 76 |
[group("docs")] |
| 77 |
doc *args: |
| 78 |
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --workspace --all-features {{ args }} |