Crates.io | cargo-manifest-check |
lib.rs | cargo-manifest-check |
version | 0.1.0 |
source | src |
created_at | 2024-10-27 09:34:57.309762 |
updated_at | 2024-10-27 09:34:57.309762 |
description | Check the formatting of your manifest files |
homepage | |
repository | https://codeberg.org/AudaciousAxiom/cargo-manifest-check |
max_upload_size | |
id | 1424436 |
size | 67,384 |
Check the formatting of your manifest files
cargo-manifest-check checks that various items from your manifest files are formatted as expected. It is currently mostly concerned with checking the order of items, and does not currently allow to automatically sort them. It may gain that ability in the future.
It is primarily intended for use in CI, and is relatively opinionated; it does not currently offer any kind of configuration.
cargo-manifest-check can be installed from source through crates.io:
cargo install --locked cargo-manifest-check
It can then be used as a Cargo subcommand to check all manifest files recursively discovered in the current directory:
cargo manifest-check
The following items are checked:
workspace.members
array[patch.*]
sectionsfeatures
arrays in dependencies[features]
sections, keeping dep:
features grouped first= { workspace = true }
) instead of a dotted key (i.e., .workspace = true
)Dependencies can be grouped (by surrounding them with blank lines), in which case ordering is checked within each group individually.
See the tests/fixtures
directory for examples of manifests that would be accepted/rejected.
The following is not currently checked:
[dependencies.foo]
)[profile.*]
keys.workspace = true
) instead of an explicit inline table (i.e., = { workspace = true }
)Support for these may be added later.
Additionally, cargo-manifest-check does not check that the manifest files are valid manifests (e.g., that keys exist and are valid); it only checks their formatting.
This linter is opinionated on purpose and it is planned to limit configuration as much as possible. However if you have found some bugs regarding formatting checking or you think some other checks could be added (where one obvious order exists), please do open an issue.
Copyright 2024 AudaciousAxiom
This project is licensed under MPL-2.0.