| Crates.io | cargo-fmt-toml |
| lib.rs | cargo-fmt-toml |
| version | 0.0.8 |
| created_at | 2026-01-03 12:18:28.368412+00 |
| updated_at | 2026-01-16 01:22:32.111949+00 |
| description | Cargo subcommand to format and normalize Cargo.toml files according to workspace standards |
| homepage | https://github.com/dataroadinc/cargo-fmt-toml |
| repository | https://github.com/dataroadinc/cargo-fmt-toml |
| max_upload_size | |
| id | 2019989 |
| size | 166,625 |
Cargo subcommand to format and normalize Cargo.toml files according
to workspace standards.
The fastest way to install pre-built binaries:
cargo install cargo-binstall
cargo binstall cargo-fmt-toml
Build from source (slower, requires Rust toolchain):
cargo install cargo-fmt-toml
{ workspace = true } for consistency[package]
section format# Format all Cargo.toml files in the workspace
cargo fmt-toml
# Preview changes without modifying files
cargo fmt-toml --dry-run
# Check if files need formatting (returns non-zero if changes
# needed)
cargo fmt-toml --check
The tool enforces this exact format for the [package] section:
[package]
name = "crate-name"
description = "Brief description"
version = { workspace = true }
edition = { workspace = true }
license-file = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }
readme = { workspace = true }
All dependency sections are sorted alphabetically:
[dependencies][dev-dependencies][build-dependencies][target.'cfg(...)'.dependencies]Add to your Makefile:
.PHONY: fmt-toml
fmt-toml:
@cargo run --package cargo-fmt-toml
.PHONY: check-fmt-toml
check-fmt-toml:
@cargo run --package cargo-fmt-toml -- --check