Every so often someone will submit a pull request that is the result of running rustfmt on a particular file, or set of files (examples: #49360, #38567, #30684).
Presumably we want to encourage fixing mistakes in the code style, though at the moment rustfmt can produce undesirable changes (e.g. see the comments in #37349). Without guidelines, these can either be merged directly, or it left up to the individual reviewer to decide which changes are preferred.
It seems to me it would be better to do one of two things:
- Add
rustfmt to tidy and ensure code always adheres to one style.
- Explicate style guidelines, and then only allow PRs fixing mistakes that haven't been spotted from earlier changes (for example, if
rustfmt is too strict or not good enough). I.e. not changing style choices that were the original intention of the author if they're not specified by the style guide.
At the moment, I think style changes are being made, through blind use of rustfmt, that leave the code in a worse state than before. I think it'd be preferable if we could avoid this; does anyone else have thoughts?
Every so often someone will submit a pull request that is the result of running
rustfmton a particular file, or set of files (examples: #49360, #38567, #30684).Presumably we want to encourage fixing mistakes in the code style, though at the moment
rustfmtcan produce undesirable changes (e.g. see the comments in #37349). Without guidelines, these can either be merged directly, or it left up to the individual reviewer to decide which changes are preferred.It seems to me it would be better to do one of two things:
rustfmttotidyand ensure code always adheres to one style.rustfmtis too strict or not good enough). I.e. not changing style choices that were the original intention of the author if they're not specified by the style guide.At the moment, I think style changes are being made, through blind use of
rustfmt, that leave the code in a worse state than before. I think it'd be preferable if we could avoid this; does anyone else have thoughts?