Re: [PATCH 2/6] ci: check formatting of our Rust code
- From
- Eric Sunshine <ericsunshine@gmail.com>
- Date
- Oct 7, 2025, 18:03 UTC
- Message-ID
- <CAPig+cRvugLP63CYUXw7pf-7obErQYenrVvNeSYhegQ57PQ8KA@mail.gmail.com>
- In-Reply-To
- <xmqqbjmik3y9.fsf@gitster.g>
On Tue, Oct 7, 2025 at 1:38 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> Eric Sunshine <ericsunshine@gmail.com> writes: > > Later in the same thread, I wrote[2]: > > > > Project guidelines have long suggested 80 columns as a desirable > > maximum not only for C code, but for pretty much all other > > resources, including shell code, Perl code, and documentation > > files. This suggested maximum works well for adherents of > > 80-columns and (presumably) hasn't been too onerous for developers > > who use wider windows; at least we haven't heard people clamoring > > to increase the suggested maximum column limit. As such, it does > > not seem far-fetched to expect that the project guidelines > > should/could/would also apply to Rust code. > > I do not see a particular reason to lift the 80-column limit for a > specific language, whether it is Rust or AsciiDoc. [...] > > Will it inconvenience wider Rust ecosystem when we get big (meaning, > they have to work with our code) and we as the project norm use > different line-length setting from others, perhaps by looking too > different from everybody else, or something?
As a general answer, I would assume that third-party projects wanting to use Rust code from the Git project would do so by importing one or more "crates" that the Git project publishes rather than importing raw code directly from the Git project. In this case they never deal directly with Git's Rust code itself, but instead interact via the Git crate's public API.
If a third-party project does want/need to import some raw Git Rust code directly but has no plans to actually edit the code, then there should be no problem. If the project does plan to edit the imported code and periodically update it from upstream Git, then it's a bit more onerous, though perhaps not so much so; running the Git upstream code through `rustfmt` before import into the project is one simple step which can easily be automated.