Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benesch/cargo-manifmt
https://github.com/benesch/cargo-manifmt
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/benesch/cargo-manifmt
- Owner: benesch
- License: apache-2.0
- Created: 2019-12-28T21:44:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-28T00:35:03.000Z (over 2 years ago)
- Last Synced: 2024-09-18T02:58:39.288Z (about 2 months ago)
- Language: Rust
- Homepage:
- Size: 35.2 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cargo-manifmt
[rustfmt] for your [Cargo.toml].
⚠️**Warning: cargo-manifmt is still under active development.** ⚠️
Running cargo-manifmt may silently corrupt your Cargo.toml file. Commit before
running cargo-manifmt, and inspect the resulting diff by hand.## Usage
Installation:
```shell
$ cargo install cargo-manifmt
```Then, from within a Cargo workspace, run:
```shell
$ cargo manifmt
```All Cargo.toml manifests within the workspace will be reformatted in place
according to cargo-manifmt's hardcoded style guide. There are intentionally
no configuration options.## Features
* Sorts package metadata into a consistent order that places the most important
keys at the time.
* Sorts dependencies alphabetically within each group.
* Rewrites standard "caret" version contraints to be fully-specified, e.g.,
rewrites `foo-dep = "1"` to `foo-dep = "1.0.0"`.
* Elides keys whose values are the default.
* Elides targets that can be automatically inferred from the repository layout.## Limitations
* Comments are only preserved if they appear on their own lines above an entry
in a features or dependencies table. If you have comments elsewhere in your
Cargo.toml, cargo-manifmt will silently remove them!* cargo-manifmt does not yet understand all entries in a Cargo.toml, and may
inadvertently remove configuration it does not understand. This is a bug,
of course, so please file an issue![Cargo.toml]: https://doc.rust-lang.org/cargo/reference/manifest.html
[rustfmt]: https://github.com/rust-lang/rustfmt