samcrow / canadensis

A Rust implementation of Cyphal
Apache License 2.0
44 stars 5 forks source link

codegen: rustfmt automatically #15

Open joleeee opened 1 year ago

joleeee commented 1 year ago

When I generate bindings they are not automatically formatted

samcrow commented 1 year ago

Thanks for suggesting this. I added a --rustfmt option in canadensis_codegen_rust 0.3.2 that just runs rustfmt on the generated code.

I'm also open to enabling that by default. The main part I'm not sure about is what should happen if rustfmt is not available: an error, a warning message, or silent failure?