paxdotdev/pax

Use rustfmt for automatic formatting

Closed this issue · 2 comments

This would require a coordinated effort:

  • the entire code base needs to be reformatted (but this is easy with cargo fmt);
  • all current development branches would have to be rebased on top of these changes;
  • a CI step that would check the formatting automatically would have to be introduced.

However, the benefits would outweigh any negatives:

  • formatting and code style consistency in the code base;
  • rustfmt is the de-facto standard for Rust projects, so it would be easier for contributors to read existing code and make new changes;
  • it would render moot any discussions about personal preferences in code style. :)

I agree we should do this. Given that we have a couple of substantial working branches ahead of master right now, I propose we sequence it roughly as:

  1. for each of @warfaj 's and my current working branches, we perform cargo fmt on our affected crates before merging, within the next week or two. I believe the branches' crates are roughly disjoint, as my current work is focused on compiler and his on renderer/runtime.
  2. clean up remaining crates manually once (the complement of crates affected by (warfa's + my) branches, wj/scroll-native and zb/dep-rethink)
  3. establish scripting + automation that affects all crates (or at the very least, a convention and an occasional manual clean-up pass.)

This should help us avoid painful rebasing and get us there with a lower total cost, with the trade-off of waiting a week or two to execute this in full.

Since our "substantial working branches" both landed as of today, I went ahead and made this happen — see #39