cargo-toml-format
cargo-toml-format copied to clipboard
Feature idea: lint workspace dependencies
Hi Timon, big fan of your crates, had this idea:
-
In
cargo_fmt_manifest.toml
:workspace-only-dependencies = [ "clap", "crossterm", "tokio", ]
-
This should now be an error:
[dependencies] clap = "4.1"
e.g.:
Error:
clap
is defined at the workspace level, yet its version is specified as "4.1". Please specify it asclap = { workspace = true }
. See:https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
Hmm, the error message should probably also mention the
workspace-only-dependencies
array.
What do you think?