Skip to content

Commit

Permalink
Use --workspace where --all is deprecated
Browse files Browse the repository at this point in the history
Most `cargo` commands that support `--all` to affect the entire
workspace rather than a single package have deprecated it in favor
of `--workspace` and treat them as synonyms. The major exception
(at least as relevant to this repository) is `cargo fmt`, which
recognizes `--all` and not `--workspace`.

This replaces `--all` with `--workspace` in `cargo check`,
`cargo doc`, and `cargo nextest` commands in a CI workflow and the
`justfile`. All these subcommands have deprecated `--all` in favor
of `--workspace`, and document this in relevant `--help` output.

(Other major subcommands that recommend `--workspace` over its
deprecated `--all` alias include `cargo build` and `cargo test`,
but there are currently no occurrences of such commands with
`--all` in this repository.)
  • Loading branch information
EliahKagan committed Nov 6, 2024
1 parent a876533 commit 14d472d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ jobs:
brew install tree openssl gnu-sed
- name: "cargo check default features"
if: startsWith(matrix.os, 'windows')
run: cargo check --all --bins --examples
run: cargo check --workspace --bins --examples
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: "Test (nextest)"
env:
GIX_TEST_CREATE_ARCHIVES_EVEN_ON_CI: 1
run: cargo nextest run --all --no-fail-fast
run: cargo nextest run --workspace --no-fail-fast
- name: Doctest
run: cargo test --doc
- name: Check that tracked archives are up to date
Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ clippy-fix:

# Build all code in suitable configurations
check:
cargo check --all
cargo check --workspace
cargo check --no-default-features --features small
# assure compile error occurs
if cargo check --features lean-async 2>/dev/null; then false; else true; fi
Expand Down Expand Up @@ -146,8 +146,8 @@ check:

# Run cargo doc on all crates
doc $RUSTDOCFLAGS="-D warnings":
cargo doc --all --no-deps --features need-more-recent-msrv
cargo doc --features=max,lean,small --all --no-deps --features need-more-recent-msrv
cargo doc --workspace --no-deps --features need-more-recent-msrv
cargo doc --features=max,lean,small --workspace --no-deps --features need-more-recent-msrv

# run all unit tests
unit-tests:
Expand Down

0 comments on commit 14d472d

Please sign in to comment.