Skip to content

Conversation

pgherveou
Copy link

@pgherveou pgherveou commented Oct 8, 2025

Copying the fmt from polkadot-sdk, without a sane configuration, rustfmt preserve local style which can produce a lot of unnecessary formatting diff

@xermicus
Copy link
Member

xermicus commented Oct 8, 2025

without a sane configuration it's hard to not produce a lot of diff when running cargo fmt locally

But this means you configured your system away from the standard configuration? FWIW I never had any issues with formatting in any Rust codebase except when working with the polkadot-sdk. Can you elaborate a bit more why this is required?

@pgherveou
Copy link
Author

pgherveou commented Oct 8, 2025

take this PR #179 that I rebased on top of this one
without the .rustmft.toml, run cargo fmt does not fix all the formatting diff.

see this PR #181 where I removed the .rustfmt.toml, it creates a lot of formatting diff that should not be in the PR even though I ran cargo fmt and CI is passing

@xermicus
Copy link
Member

xermicus commented Oct 8, 2025

I see, very unexpected to me that cargo fmt --all does, well, not format all.

Really don't get it. Running the formatter on main creates no changes. In your PR branch it re-formats (otherwise untouched) files. Not sure what's going on and why. Just ape it in.

@pgherveou
Copy link
Author

yeah by default rustfmt preserve local style which is not great when multiple people work on a project with different version config of rustfmt

@pgherveou pgherveou enabled auto-merge October 8, 2025 11:40
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