mainmatter / cargo-autoinherit

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

[Feature Request] Convert existing `TK.workspace = true` #25

Open AlJohri opened 3 months ago

AlJohri commented 3 months ago

I have a bunch of crates that are already using the TK.workspace = true format in Cargo.toml. It would be great that as part of the process for running cargo-autoinherit autoinherit, it converts the existing inherited packages into the same format of crate = { workspace = true }.

Currently my Cargo.toml has a mix of formats after running the tool:

bincode.workspace = true
byteorder = { workspace = true }
cbgbt commented 2 weeks ago

While it doesn't solve this problem by rewriting existing lines, I have a PR open which allows you to pass --prefer-simple-dotted to the tool, which will use the dependency.workspace = true format when rewriting dependencies. (https://github.com/mainmatter/cargo-autoinherit/pull/29)

I'm not sure if the maintiners are interested in merging it, but I used this on some of my own workspaces with success.