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

From: "brian m. carlson" <[email-masked]>
Date: Tue, 7 Oct 2025 22:07:01 +0000

On 2025-10-07 at 12:36:30, Patrick Steinhardt wrote:
> Introduce a CI check that verifies that our Rust code is well-formatted.
> This check uses rustfmt(1), which is the de-facto standard in the Rust
> world.
> 
> The rustfmt(1) tool allows to tweak the final format in theory. In
> practice though, the Rust ecosystem has aligned on style "editions".
> These editions only exist to ensure that any potential changes to the
> style don't cause reformats to existing code bases. Other than that,
> most Rust projects out there accept this default style of a specific
> edition.
> 
> Let's do the same and use that default style. It may not be anyone's
> favorite, but it is consistent and by making it part of our CI we also
> enforce it right from the start.

Yes, I think this is the right decision.  We _can_ customize it if we
want, but I never do, even though I don't love some of the policies
(like the cuddled elses), since having a fixed standard avoids all of
the argument.  The Rust code I'll be sending in within the next few
weeks already uses rustfmt.

Even if we did decide to customize it, I think there's enormous value in
just being able to run the tool and accept what it outputs, saving us
enormous amounts of time not having to discuss style nits.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA