rust-lang / rust-lang/rustfmt

Could rustfmt format Cargo.toml ?

Open
#4,091 45 comments 119 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request S-blocked
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

I actually use a very very small tool toml-fmt, I currently use it like:

toml-fmt < Cargo.toml > Cargo.toml.new && mv Cargo.toml.new Cargo.toml

That not very practical and I must remember to use it. Could rustfmt handle it too ? I think Cargo.toml is also a part of rust file so maybe it's ok to add it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Cargo.toml usage example in the issue and inspect the linked toml-fmt tool to understand the requested formatting behavior. Done means establishing whether rustfmt should support Cargo.toml and agreeing on the scope and expected output before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.