What it does
dev-deps answers two questions about your dependency tree:
- Are any declared dependencies actually unused?
- Are any outdated, and by how many major versions?
It wraps cargo-udeps and
cargo-outdated and emits
findings as a dev-report::Report so AI
agents and CI gates can act on them programmatically.
Quick start
[]
= "0.9"
One-time tool install:
Drive it from code:
use ;
let check = new.scope;
let result = check.execute?;
let report = result.into_report;
println!;
# Ok::
Scopes
| Scope | What it runs |
|---|---|
DepScope::Unused |
cargo +nightly udeps --output json only. |
DepScope::Outdated |
cargo outdated --format json only. |
DepScope::All |
Both. |
Severity policy
| Finding | dev-report::Severity |
|---|---|
| Unused dependency | Warning |
| Outdated, 0–1 major behind | Info |
| Outdated, 2+ majors behind | Warning |
Outdated, ≥ escalate_at_majors behind |
Error (failing) |
By default, every finding is a Warn-verdict check — dependency
health is advisory, not blocking. Call .escalate_at_majors(n) on the
builder to make findings at least n majors behind produce a failing
CheckResult instead.
Allow-list, exclude, and severity threshold
use ;
use Severity;
let check = new
.scope
.workspace // pass --workspace to both tools
.exclude // skip a whole crate
.allow // skip a single advisory ID / crate name
.allow_all
.severity_threshold // drop Info findings
.escalate_at_majors; // fail when 3+ majors behind
let _result = check.execute?;
# Ok::
Producer integration
DepProducer plugs the check into a multi-producer pipeline driven
by dev-tools:
use ;
use Producer;
let producer = new;
let report = producer.produce;
println!;
Subprocess failures map to a single failing CheckResult named
deps::health with Severity::Critical — the pipeline keeps running.
Wire format
DepResult, UnusedDep, OutdatedDep, DepScope, and DepKind
are all serde-derived. JSON output uses snake_case field names
and omits optional fields when they are None:
Examples
| File | What it shows |
|---|---|
examples/basic.rs |
Full check (All scope); graceful tool-missing handling. |
examples/unused_only.rs |
Unused scope only. |
examples/outdated_only.rs |
Outdated scope only. |
examples/producer.rs |
DepProducer (gated by DEV_DEPS_EXAMPLE_RUN). |
Requirements
Both tools must be installed:
The crate detects absence of either tool and surfaces a typed
DepError variant rather than panicking.
Runtime dependency footprint: dev-report, serde, serde_json.
Migration from 0.1.0
UnusedDep::kind was a String in 0.1.0; it is now a typed DepKind
enum. OutdatedDep also gained an optional kind field. If you
constructed these struct literals in 0.1.0, update:
# use ;
let _unused = UnusedDep ;
let _outdated = OutdatedDep ;
The constructor surface (DepCheck::new, DepScope variants,
DepResult::into_report) is unchanged.
The dev-* suite
See dev-tools for the
umbrella crate covering the full suite.
Status
v0.9.x is the pre-1.0 stabilization line. The API is feature-complete
for unused-dependency detection, outdated-version detection, major-lag
escalation, allow-listing, and severity gating. Production use is fine;
1.0 will pin the public API and the wire format.
Minimum supported Rust version
1.85 — pinned in Cargo.toml via rust-version and verified by
the MSRV job in CI.
License
Apache-2.0. See LICENSE.