Cargo Sort Check
A tool to check that your Cargo.toml dependencies are sorted alphabetically. Project inspired by jpoles1 as a solution to @dtolnay's request for implementation #29. Cross platform implementation, windows compatible. Checks/sorts by key in tables and also nested table header (does not sort the items in a nested header). To pass the nested tables must be grouped.
included in sort check is:
[]
[]
[]
[]
[]
Install
Run
Defaults to current dir but any path can be passed in.
<CWD> Sets
Wildcard expansion is supported so you can do this
or any other pattern that is supported by your terminal. This also means multiple paths work.
These are all valid, file name and extension can be used on some of the paths, if left off the default is still Cargo.toml.
Examples
[]
="0.1.1"
# comments will stay with the item
="0.1.1"
# ILLEGAL no newline in table items
="0.1.1"
[]
="0"
[]
="0"
="0"
# comments will also stay with header
[]
="0"
[]
="0"
[]
="0"
="0"
Will sort to, or fail until organized like so
[]
="0.1.1"
="0.1.1"
# comments will stay with the item
="0.1.1"
[]
="0"
[]
="0"
# comments will also stay with header
[]
="0"
[]
="0"
="0"
[]
="0"
="0"