Skip to content

Switch unused-dependency check from cargo-machete to cargo-shear#255

Merged
lukevalenta merged 1 commit into
mainfrom
lvalenta/cargo-shear
Jul 13, 2026
Merged

Switch unused-dependency check from cargo-machete to cargo-shear#255
lukevalenta merged 1 commit into
mainfrom
lvalenta/cargo-shear

Conversation

@lukevalenta

Copy link
Copy Markdown
Contributor

cargo-machete only inspects each crate's own dependency tables, so it misses unused entries in the workspace root and has substring-based false negatives. cargo-shear works from the resolved dependency graph and catches both, including unused [workspace.dependencies].

Swap the tool in CI, AGENTS.md, and the ct_worker README, then clean up the dead deps shear surfaced.

Also fixes a latent TOML bug where integration_tests' homepage, repository, and description keys sat inside the cargo-machete metadata table instead of [package].

cargo-machete only inspects each crate's own dependency tables, so it
misses unused entries in the workspace root and has substring-based
false negatives. cargo-shear works from the resolved dependency graph
and catches both, including unused `[workspace.dependencies]`.

Swap the tool in CI, AGENTS.md, and the ct_worker README, then clean up
the dead deps shear surfaced.

Also fixes a latent TOML bug where integration_tests' homepage,
repository, and description keys sat inside the cargo-machete metadata
table instead of [package].
@lukevalenta lukevalenta self-assigned this Jul 13, 2026
@lukevalenta lukevalenta added the dependencies Pull requests that update a dependency file label Jul 13, 2026
@lukevalenta

Copy link
Copy Markdown
Contributor Author

/bonk review

@ask-bonk

ask-bonk Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR #255 – Switch unused‑dependency check from cargo‑machete to cargo‑shear

Summary of changes

  • CI workflow (.github/workflows/rust.yml) now installs and runs cargo-shear instead of cargo-machete.
  • Updated AGENTS.md and crates/ct_worker/README.md to reference cargo shear in the pre‑push checklist.
  • Fixed TOML metadata for integration_tests (homepage, repository, description now correctly under [package]).
  • Cleaned up dead dependencies across multiple crates (removed unused entries from various Cargo.tomls).
  • Added a workspace.metadata.cargo-shear ignore for getrandom (feature‑only edge case).
  • Adjusted Cargo.lock accordingly.

Verification

  • Build: cargo build --workspace succeeds with no errors.
  • Tests: cargo test --workspace runs all unit tests successfully (13 + 5 + 1 + 50 ≈ 69 tests, all passing).
  • Unused‑dependency check: cargo shear runs without reporting any unused dependencies (no output → clean).
  • No remaining references to cargo-machete in the repository.

Risks / Open items

  • None identified. The switch to cargo-shear improves detection of unused workspace‑level dependencies and the repository now passes all CI checks locally.

Conclusion: The PR cleanly replaces the old tool, updates documentation, removes dead code, and passes all build, test, and lint steps. No further changes are required.

github run

@lukevalenta
lukevalenta merged commit 25bcb50 into main Jul 13, 2026
7 checks passed
@lukevalenta
lukevalenta deleted the lvalenta/cargo-shear branch July 13, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants