Skip to content

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

Closed

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-core → torrust-rest-tracker-api-client [dev]
  • bittorrent-udp-tracker-core → torrust-tracker-test-helpers [dev]
  • torrust-axum-http-tracker-server → torrust-tracker-events [dev]
  • torrust-tracker-swarm-coordination-registry → torrust-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

Activity

  1. self-assigned this
    on May 20, 2026
  2. added 5 commits that reference this issue on May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions