Tool to enforce that Cargo.toml dependencies are written in sorted order · Issue #29 · dtolnay/request-for-implementation (original) (raw)
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
Description
$ cargo dependencies-sorted? path/to/Cargo.toml; echo $? 0
Large projects tend to like for things to stay sorted to cut down the occurrence of merge conflicts between two developers appending to the end of the same unsorted list in parallel changes. Similar idea behind the remain crate.
The command should parse a Cargo.toml and validate that particular pieces are sorted, exiting 0 if all sorted and nonzero otherwise.
We would at least want to check:
[dependencies]
[dev-dependencies]
[build-dependencies]
[workspace.members]
[workspace.exclude]
Take a look at the documentation for Cargo.toml to see whether any other parts make sense to enforce as sorted.