genemichaels icon indicating copy to clipboard operation
genemichaels copied to clipboard

Discussion: integrate`genemichaels` into `cargo fmt` as preprocessor

Open wongjiahau opened this issue 1 year ago • 1 comments

While genemichaels is excellent at being uncompromisable, its style changes are too aggressive. I feel like it has its place best suited as a preprocessor before cargo fmt that cleans up the dirty mess that cargo fmt deemed unredeemable.

I really like the result of this combination, where imports are auto-sorted, long strings are formatted, and code style stays as rustfmt-eque as possible.

Would it be possible to integrate this tool directly into cargo fmt as a preprocessor?

wongjiahau avatar Dec 06 '24 01:12 wongjiahau

I think that's probably a question for the cargo fmt people, but my guess is that it wouldn't be accepted since they've previously expressed (IIRC) no interest in this sort of formatting and it would double both the code complexity and formatting run-time.

Do you have some examples of changes? I can't promise anything (time wise, especially) but it might be possible to modify the output to be more similar to what you're expecting.

andrewbaxter avatar Dec 06 '24 14:12 andrewbaxter