Now that the Rust 2018 release is approaching, I think we should talk about how to apply rustfmt to the rust repository, and how to keep it formatted.
Using rustfmt would have several wins:
- Adopt a uniform style, of course
- But also resolve problems that contributors have either:
- trying to figure out our style (heh, good luck)
- accidentally running rustfmt on stuff that drags in a lot of auxiliary diffs
There are obviously two main approaches:
- Flag day
- Gradual transition
I am partial to “flag day” myself, but I could go either way.
There is another question too: how to keep things formatted? In my ideal world, this would be fairly painless, but I’m not sure how best to achieve that (one idea I had was a rustfmtbot that runs rustfmt on people’s PRs and pushes commits automatically, but that does not exist afaik).