Clippy / rustfmt but for cargo.toml file?

⚓ Rust    📅 2026-01-15    👤 surdeus    👁️ 2      

surdeus

Is there anything currently viable that is akin to Clippy and rustfmt but for the Cargo.toml file?

Some time ago, there was a project called cargo-toml-lint but it seems to have fallen into disrepair. (Last release was 3+ years ago.)

I'd love to see something that enforces a few common formatting rules and (IMHO) best practices for our Cargo.toml files. Some things I'd love to see:

  • Crates listed in alphabetical order.
  • TOML formatting is consistent (spaces inside { } pairs, no spaces inside [ ] pairs).
  • Top-level settings listed in a consistent order. (Perhaps same sequence as documentation.)
  • One blank line before new sections.

Is there such a thing?

2 posts - 2 participants

Read full topic

🏷️ Rust_feed