Skip to content

replace cargo fmt with the prettyplease crate #880

@yoshuawuyts

Description

@yoshuawuyts

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    gen-rustRelated to bindings for Rust-compiled-to-WebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions