Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace cargo fmt with the prettyplease crate #880

Closed
yoshuawuyts opened this issue Mar 4, 2024 · 0 comments · Fixed by #971
Closed

replace cargo fmt with the prettyplease crate #880

yoshuawuyts opened this issue Mar 4, 2024 · 0 comments · Fixed by #971
Labels
gen-rust Related to bindings for Rust-compiled-to-WebAssembly

Comments

@yoshuawuyts
Copy link
Member

yoshuawuyts commented Mar 4, 2024

In order to more structurally work around code formatting issues like those described in #878, we should consider switching from cargo fmt to Dtolnay's prettyplease crate. This crate was designed specifically to format codegen; meaning it will format faster, fail less frequently, but may occasionally result in subtly different formatting than what cargo fmt would have come up with.

I've used this succesfully in my http-bindgen crate, and I believe this might work better for wit-bindgen too. In practice I've yet to experience any divergent code formatting output. If we're worried about this becoming an issue however, we could always add a #![rustfmt::skip] attribute to the top of our generated files. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gen-rust Related to bindings for Rust-compiled-to-WebAssembly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants