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

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 8 Oct 2025 06:46:06 +0200

On Tue, Oct 07, 2025 at 10:42:16PM +0000, brian m. carlson wrote:
> On 2025-10-07 at 17:13:18, Eric Sunshine wrote:
> > 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.
> 
> My preference is actually that we stick with the default.  I use (and
> for a long time have used) a 132-character editor window and I find it
> quite useful to have the extra space.  The DEC VT100 did 132 columns
> (available on your local Linux system as `vt100-w`), so I think there's
> plenty of precedent for that being an acceptable width[0].
> 
> I did previously use 80-column terminals when I had a tiny laptop
> screen, but modern display resolutions over the past decade, even on
> smaller laptops, have made it entirely possible to get several wider
> terminal windows (or in my case, tmux panes) on one screen.  One of my
> current tmux panes is now 213×54 and I really enjoy the extra space.
> 
> The default Rust behaviour is 100 characters[1], which I think is a fine
> default.  I won't be enormously angsty if we say we still absolutely
> must stick to 80-character lines, but I also think we should take this
> opportunity to choose the Rust defaults for Rust.  C, Perl, and text
> formats like AsciiDoc do not have rigid defaults about indentation
> style, tabs vs. spaces, and line length; Rust does.  We wouldn't use
> tabs in Rust (the default is four spaces) because we use it everywhere
> else, so I think we should take the opportunity to use the Rust defaults
> here as well.

I am also slightly leaning into the direction of sticking with Rust's
default of 100 characters. It's not substantially more than 80, should
be reasonable to accommodate for in most modern setups, and sticks with
what the remainder of the ecosystem is doing.

So for now I'll leave it at 80 characters. But I don't feel strongly
about this, so if there is a majority in favor of 80 characters I'm
happy to adjust.

Thanks!

Patrick