cargo-unleash icon indicating copy to clipboard operation
cargo-unleash copied to clipboard

add `cargofmt` to clean up cargo.toml files

Open gnunicorn opened this issue 4 years ago • 1 comments

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.

gnunicorn avatar Mar 24 '20 10:03 gnunicorn

One day it will come as standard ... https://github.com/rust-lang/rustfmt/issues/4091

gilescope avatar Jul 28 '21 16:07 gilescope