Use rustfmt for automatic formatting
Closed this issue · 2 comments
nbaksalyar commented
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. :)
zackbrown commented
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:
- 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. - clean up remaining crates manually once (the complement of crates affected by (warfa's + my) branches,
wj/scroll-native
andzb/dep-rethink
) - 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.