git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/6] ci: check formatting of our Rust code

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2025, 17:38 UTC
Message-ID
<xmqqbjmik3y9.fsf@gitster.g>
In-Reply-To
<CAPig+cQ7xJky+F=g=NMrN6BQfP+ZV2KF4RF2eLqtULKgMTR5_g@mail.gmail.com>
Eric Sunshine <ericsunshine@gmail.com> writes:
Show 32 quoted lines
>     I bring this up because, although it hasn't been such a big deal
>     with the existing C code, assuming that developers run `rustfmt`
>     on the code before sending a patch series, then this may become an
>     issue if different developers have `rustfmt` configured to enforce
>     different maximum column width, especially since `rustfmt` is
>     likely to reformat the entire file rather than just the region
>     that has just been edited.  So, if this code gets checked in as-is
>     with these very wide lines, and then someone else, who has
>     `rustfmt` configured for 80-columns edits the file, then it
>     becomes a problem.
>
>     As such, can we also add a project-wide `rustfmt.toml` which, at
>     minimum, sets the maximum line width to 80? For instance:
>
>         max_width = 80
>
> 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.
>
> Unfortunately, what little discussion there was petered out quickly
> without resolution, but it seems that it would be a good idea to make
> some sort of decision earlier (while there is still very little Rust
> code committed to the project) rather than later.

I do not see a particular reason to lift the 80-column limit for a specific language, whether it is Rust or AsciiDoc. I myself use my terminal set to slightly wider than 80 columns these days, but that is primarily to accomodate the fact that code in a patch that are quoted a few times in the discussion would grow from their original line length, not to write pieces of code that are wider than 80 columns myself.

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?

Previous: Eric SunshineNext: Eric Sunshine
Message 9 of 37 in “ci: improvements to our Rust infrastructure”
  1. 0/6 ci: improvements to our Rust infrastructurePatrick Steinhardt, Oct 7, 2025
  2. 1/6 ci: deduplicate calls to `apt-get update`Patrick Steinhardt, Oct 7, 2025
  3. Karthik NayakOct 7, 2025
  4. Justin ToblerOct 14, 2025
  5. 2/6 ci: check formatting of our Rust codePatrick Steinhardt, Oct 7, 2025
  6. Karthik NayakOct 7, 2025
  7. Patrick SteinhardtOct 7, 2025
  8. Eric SunshineOct 7, 2025
  9. Junio C HamanoOct 7, 2025
  10. Eric SunshineOct 7, 2025
  11. brian m. carlsonOct 7, 2025
  12. Chris TorekOct 7, 2025
  13. Patrick SteinhardtOct 8, 2025
  14. Junio C HamanoOct 8, 2025
  15. Patrick SteinhardtOct 9, 2025
  16. SZEDER GáborOct 29, 2025
  17. brian m. carlsonOct 7, 2025
  18. SZEDER GáborOct 8, 2025
  19. Patrick SteinhardtOct 9, 2025
  20. SZEDER GáborOct 29, 2025
  21. 3/6 rust/varint: add safety commentsPatrick Steinhardt, Oct 7, 2025
  22. brian m. carlsonOct 8, 2025
  23. Patrick SteinhardtOct 8, 2025
  24. 4/6 ci: check for common Rust mistakes via ClippyPatrick Steinhardt, Oct 7, 2025
  25. 5/6 ci: verify minimum supported Rust versionPatrick Steinhardt, Oct 7, 2025
  26. 6/6 rust: support for WindowsPatrick Steinhardt, Oct 7, 2025
  27. 0/6 ci: improvements to our Rust infrastructurePatrick Steinhardt, Oct 15, 2025
  28. 1/6 ci: deduplicate calls to `apt-get update`Patrick Steinhardt, Oct 15, 2025
  29. 2/6 ci: check formatting of our Rust codePatrick Steinhardt, Oct 15, 2025
  30. 3/6 rust/varint: add safety commentsPatrick Steinhardt, Oct 15, 2025
  31. 4/6 ci: check for common Rust mistakes via ClippyPatrick Steinhardt, Oct 15, 2025
  32. 5/6 ci: verify minimum supported Rust versionPatrick Steinhardt, Oct 15, 2025
  33. 6/6 rust: support for WindowsPatrick Steinhardt, Oct 15, 2025
  34. Ezekiel NewrenNov 20, 2025
  35. Johannes SchindelinNov 21, 2025
  36. Junio C HamanoNov 21, 2025
  37. Junio C HamanoOct 15, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.