-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Format resulting code #884
Comments
Sounds like a reasonable idea. I guess adding an optional cli argument that would trigger rustfmt as a post script, would not be enough right? I assume you as the template author would like to be in charge of controlling that rustfmt runs or not, right? |
That could be an option
Maybe not, why not format all the resulting code? Maybe have a cli argument to opt-out but, by default, I think it's a good thing that the resulting code is properly formatted, just my 2 cents. |
I like this :-) I like the idea as a 'opt-in' most though, but at the same time, I'd suggest that the template itself could opt-in by specifying it in the Also, I would make it so that |
I didn't think of it this way, but I really like this idea! |
as an extra bonus, using |
I'm thinking of providing some sort of cargo-generated provided "post-processors" that one can then select by name in their template config / or own config. For example a post processor for "cargo build" or "cargo fmt" where the command and execution logic is provided by cargo-generate and the template author can specify the list of post processors they want to opt in. The User executing this very template should be prompted if they also want to run this post processing step. This way the end user can opt out interactively. For running without a user (CI), there should be a |
Hi! Is there any progress or update regarding this feature? |
The work on this feature as drafted above did not yet start. |
Hi! Would it be possible to add a mechanism that formats (with
rustfmt
) the generated code? We are currently working on https://github.com/esp-rs/esp-template and we face the following:cargo fmt
, we have some issue as we generate the template in some CI and Dockerfiles that do not have therustfmt
component installedmain.rs
The text was updated successfully, but these errors were encountered: