Skip to content

Use cargo machete --with-metadata and remove unused dev dependencies #1804

@josecelano

Description

@josecelano

Goal

Replace the plain cargo machete call in the pre-commit hook (and CI) with
cargo machete --with-metadata, then remove the ~15 unused dev dependencies that this
stricter mode reveals across the workspace.

Background

During a coupling analysis review, four workspace dependencies were found to have zero references
in any source file:

  • bittorrent-tracker-coretorrust-rest-tracker-api-client [dev]
  • bittorrent-udp-tracker-coretorrust-tracker-test-helpers [dev]
  • torrust-axum-http-tracker-servertorrust-tracker-events [dev]
  • torrust-tracker-swarm-coordination-registrytorrust-tracker-test-helpers [dev]

Running cargo machete (plain, text-based scan) did not flag these — a false negative. Only
cargo machete --with-metadata correctly identifies them as unused. The same run also reveals
about a dozen additional unused dev dependencies spread across the workspace (e.g.,
local-ip-address, mockall, rstest, async-std, criterion, pretty_assertions,
serde_bytes, zerocopy, tracing-subscriber, formatjson, serde_json).

Switching to --with-metadata makes the gate accurate and removes dead weight from Cargo.toml
files across the workspace.

Spec

Full specification: docs/issues/open/ (see spec file for this issue number).

Related

  • Part of Overhaul: packages #1669 (EPIC — Overhaul Packages)
  • See also: companion issue for the workspace-coupling report tool overhaul

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions