Skip to content

chore: add cargo fmt to the CI to ensure it is always checked#66

Closed
szabgab wants to merge 1 commit into
kornelski:mainfrom
szabgab:rustfmt
Closed

chore: add cargo fmt to the CI to ensure it is always checked#66
szabgab wants to merge 1 commit into
kornelski:mainfrom
szabgab:rustfmt

Conversation

@szabgab

@szabgab szabgab commented Jan 18, 2026

Copy link
Copy Markdown

Also add the rustfmt component to the ci

Also add the rustfmt component to the ci
@kornelski

Copy link
Copy Markdown
Owner

Sorry, I don't want to reject PRs due to rustfmt.

It's unpleasant to get a build fail, PR blocked, and waste time manually push a fix for a nitpicky triviality that could be fixed anytime later.

rustfmt is IMO an architecturally flawed tool. It can make diffs larger (deletion of a single line can reformat a whole block), which makes reviewing harder. It makes a ton of poor choices due to having context-free formatting and no common sense, e.g. it won't keep all match arms use the same block or expression style if their line lengths cross different limits.

go fmt works way better by keeping the high-level layout choices from the input file, trusting people's common sense, and only fixes tedious stuff it understands.
rustfmt is built with the goal of complete destruction of the original formatting, expressing utter distrust of any human judgement, and I find that gross.

@szabgab

szabgab commented Jan 19, 2026

Copy link
Copy Markdown
Author

I hear you. So do you run cargo fmt yourself and make that a separate commit?

@kornelski

Copy link
Copy Markdown
Owner

Yes, I occasionally run cargo fmt manually if I notice formatting that needs fixing. I wish there was a tool I could trust to format automatically, but rustfmt isn't it.

@szabgab szabgab closed this Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants