mainmatter / cargo-autoinherit

(Auto)DRY for your Rust dependencies
Apache License 2.0
130 stars 8 forks source link

Option for `foo.workspace = true` #15

Open tgeoghegan opened 7 months ago

tgeoghegan commented 7 months ago

autoinherit will insert dependencies of the form foo = { workspace = true}. However a project might already have inherited dependencies written in the form foo.workspace = true. Either form is fine, what I really care about is consistency. So it'd be nice to either be able to choose a style when invoking cargo autoinherit, or to have an option to rewrite inherited dependencies into autoinherit's preferred form.

LukeMathWalker commented 6 months ago

I don't want cargo-autoinherit to become a formatter for Cargo.toml manifests.
There's an ongoing initiative in the cargo team to cover that need and it's better to avoid overlaps. At the same time, what has been established so far doesn't cover workspace dependencies.

Given the above, I think we can consider adding a CLI option to cargo-autoinherit to choose which style should be used for newly inherited dependencies. That option will be deprecated once cargo decides which style is "canonical".