Have there ever been any discussions about formatting all of the compiler with rustfmt so it is all standardized and the same? Or are there reasons why that cannot be done?
Just something I was curious about.
I thought that it's been happening piecemeal.
The big "reason" I can see is that it will likely break every outstanding PR ;-)
Yeah, I was thinking that it could be done module-by-module, a PR that formats it all and then adds a check to tidy so that it can't regress.
If it has been happening piecemeal then am I right in thinking that it isn't being checked by tidy to make sure code is kept formatted by rustfmt?
I have not seen any such checks (but I'm a lightweight bystander)
@davidtwco I would really like to see this happen. I want to be able to enable rustfmt-on-save so badly.
What would it take? A flag day could be handled by writing a script people could use to
git filter-branch on their pending patches. Or, maybe it could be done directory-by-directory somehow?
maybe it could be done gradually
there's this issue: https://github.com/rust-lang/rust/issues/49567
it does mess git blame up entirely, which can be annoying
it's not checked in
tidy at the moment, but it would need to be
I think once the Edition is released we should just do a flag day and be done with it
for tidy, running rustfmt as a user could be something like --bless, then for travis, if tidy runs rutstfm and theres a diff, tidy fails (as if it wasnt mercilous enough)
I think that just running rustfmt on a module in a PR and adding a tidy check for new code. After that everyone will just get used to running that on everything for tidy to pass.
flag day would pull the bandaid
Is there any issue with the CI running rustfmt itself? Is it simply that we don't fully trust rustfmt yet?
I don't think it is desirable for the CI to actually reformat code, but I think there's some consensus that the CI would run rustfmt in a mode where it will check that a code is formatted. Much in the same way tidy won't wrap lines for you, just tell you that the lines are too long.
And why isn't it desirable?
Many people (myself included) are pretty wary of automated tools creating git commits containing actual substance.