cargo-unleash
cargo-unleash copied to clipboard
add `cargofmt` to clean up cargo.toml files
When editing cargo.toml files a few things happen that make the result a little unclean:
- when updating the version, we sometimes have to add it and that leads to unclean spacing in inline-tables
- the order of dependency attributes is mixed up, instead it should be fixed and deterministic – to allow for quicker parsing. We should think a bit about a good order, alphabetical might not be the best suited but something like :
version
,optional
,default-features
,features =
,git
,path
...
A new subcommand should enforce this formatting, potentially have a checking function that can be invoked as either "warn" or "error" on cargo unleash check
.
One day it will come as standard ... https://github.com/rust-lang/rustfmt/issues/4091