# rustfmt

6 Hacker News commenters recommended rustfmt and 4 criticized it, November 2025 to November 2026. It was recommended in 5 of 13 months.

**Verdict:** Rust's official code formatter, recommended for ending style debates and enforcing one consistent style across projects. Critics find its automatic line breaking and alignment frustrating.

## Why people recommend it

- Ends style debates across teams (3 comments): "enforcing the same style ends all of the drama" ([source](https://news.ycombinator.com/item?id=45788061)) "strict and deterministic systems like rustfmt" ([source](https://news.ycombinator.com/item?id=47298951)) "I love gofmt, rustfmt, ruff." ([source](https://news.ycombinator.com/item?id=49061675))
- Shared config across repositories (2 comments): "I've got a `.rustfmt.toml` file in all my repos with hard_tabs = true" ([source](https://news.ycombinator.com/item?id=48262101)) "taking a look at fmt & clippy configs helps too" ([source](https://news.ycombinator.com/item?id=50186837))

## What people warn about

- Unpredictable line breaking and alignment (3 comments): "The built-in formatter drives me insane it's always choosing or not choosing to line break in places that make zero semantic sense." ([source](https://news.ycombinator.com/item?id=49847749)) "But rustfmt would insist on returning it to this disappointment" ([source](https://news.ycombinator.com/item?id=46334079)) "Guess, another decade before Rust robots can do columns?" ([source](https://news.ycombinator.com/item?id=50191489))
- Only useful for indentation width (1 comments): "It's basically inferior for everything except forcing everyone to use the same indentation width" ([source](https://news.ycombinator.com/item?id=48261929))

## Alternatives hackers recommend

- [gofmt](https://hackerapproved.com/p/gofmt.md): 26 recommend
- [Black](https://hackerapproved.com/p/black.md): 18 recommend
- [FracturedJson](https://hackerapproved.com/p/fracturedjson.md): 18 recommend
- [Prettier](https://hackerapproved.com/p/prettier.md): 16 recommend
- [Oxfmt](https://hackerapproved.com/p/oxfmt.md): 14 recommend

## Cite as

Hacker Approved, "rustfmt", https://hackerapproved.com/p/rustfmt/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
