<#19892 Remove custom rustfmt rules (use 4 spaces ...
# github-notifications
c
#19892 Remove custom rustfmt rules (use 4 spaces per tab) Issue created by tgolsson I'm suggesting harmonizing the Rust code formatting with the rest of the rust ecosystem by removing the custom rustfmt rules, which in effect is the tab-size. I'd like to make three arguments for this. First of all, I'd argue that following community practices helps attract and on-board potential contributors. Rust is a language strongly centered around open-source, and has lots of very active projects. I'd wager a large majority of these projects use default rustfmt rules, with a few optional clippy lints, and a tool like
cargo deny
or
cargo audit
. While there's certainly flavors and unique styles within these projects, it's fairly easy to go into a project and instantly recognize patterns purely by indentation. Changing this - while still keeping the shape - makes the flow less apparent. This is exacerbated by Pants rust code being exceptionally dense vertically in some places. Second of all; I'd argue that Pants Rust formatting is weird given that Pants Python code does use 4 spaces, also a standard. It'd have made more sense to harmonize Rust and Python, and thus using 2 spaces for Rust would have made sense if Python already used 2 spaces. Alas, with the current setup the tab-size is different between different components of Pants. Third and finally, I'd argue that the only good time to change code formatting style was yesterday, with today being a far second. I realize that changing this is a huge amount of churn, and some passing struggles. As Pants keeps growing (in user-count, Rust LOC, contributor-count, ...) the potential cost of changing will keep getting bigger. pantsbuild/pants