#deps #graph #rules #cargo-lock #lint #enforcing #deplint

app cargo-deplint

A utility for enforcing rules about crate dependency graphs

1 unstable release

0.1.0 Sep 8, 2023

#698 in Cargo plugins

Download history 10/week @ 2024-10-16 26/week @ 2024-10-23 66/week @ 2024-10-30 43/week @ 2024-11-06 89/week @ 2024-11-13 30/week @ 2024-11-20 77/week @ 2024-11-27 36/week @ 2024-12-04 11/week @ 2024-12-11 5/week @ 2024-12-18 25/week @ 2024-12-25 3/week @ 2025-01-01 20/week @ 2025-01-08 33/week @ 2025-01-15 37/week @ 2025-01-22 8/week @ 2025-01-29

98 downloads per month

Apache-2.0

12KB
236 lines

cargo-deplint

A utility for enforcing rules about crate dependency graphs.

cargo deplint can be installed with cargo install. The resulting binary should then be in $HOME/.cargo/bin.

$ cargo install cargo-deplint

Use it by providing the path to a Cargo.lock file and a lints file:

$ cargo deplint Cargo.lock deplints.toml

Format of the lints file

The file defining the lints is a toml that looks as follows.

[[deny]]
name = "foo"
dependencies = [
    "bar",
]

The above disallows crate foo from depending on crate bar, including transitively.

TODO

  • Return all indirect dep paths in deny output.
  • Add features necessary to replace mz's lint-deps.sh (allowlist + ???).
  • Consider using cargo metadata instead of the Cargo.lock file so that we can distinguish between regular dependencies and dev-dependencies.

Dependencies

~0.5–1.1MB
~25K SLoC