[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd004ac5-9e51-4e90-a3a4-025d74941a38@nvidia.com>
Date: Fri, 3 Oct 2025 18:53:34 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Dave Airlie <airlied@...il.com>, Miguel Ojeda <ojeda@...nel.org>,
Sima Vetter <sima@...ll.ch>, dri-devel <dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [git pull] drm for 6.18-rc1
On 10/2/25 2:04 PM, Miguel Ojeda wrote:
> On Thu, Oct 2, 2025 at 9:54 PM Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
...
> In any case, for you, my intention wasn't that you had to fight the
> formatting, but rather that after solving the conflict (without
> thinking about formatting) you would run `make ... rustfmt`, i.e.
This works really well.
The other piece of Rust for Linux lore we (nova developers) picked up
was, "connect rustfmt(1) to your editor's file save command". And that
works even better.
> instead of the other one, `rustfmtcheck` (which is intended for e.g.
> CIs).
>
> Leaving non-formatted files does hurt us, though... e.g. CIs check it,
> and I think people are generally happy about the simplicity of
> formatting on the Rust side.
Very happy! Far more so than I expected. Being able to *not* fuss around
with minor formatting details (while editing, rebasing, and reviewing)
has been absolutely transformative.
It's like taking off your backpack and just leaving it behind on a hike,
but without leaving anything important behind.
...except...
>
> So if the conflicts are already too frequent and/or painful to deal
> with, then I would say we should already start writing the imports in
> a way that reduces the conflict potential, yet making it pass
> `rustfmt`. It may be uglier than what some may like (depending on who
> one asks), but it keeps the `rustfmt`-clean property and eventually we
> may be able to get `rustfmt` to give us the formatting we want and
> migrate to that.
The main complaint with rustfmt is that it is extremely twitchy and
unstable with respect to one-line, vs. multi-line output.
*Especially* with "use" statements.
For example, on today's linux.git, I just now ran it, and you can guess
what happened: it changed its little mind about yet another use
statement! See below.
If we can make just the "use" statements stop jumping around between
single line vs. multi-line output, just that small change will make a
big difference in stamping out some of the day to day noise from this
tool.
And of course, extending that multi-line decision stability to other
areas will also be a welcome change.
$ make rustfmt
$ git diff
diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kvec.rs
index e94aebd084c8..1d6cc81bdeef 100644
--- a/rust/kernel/alloc/kvec.rs
+++ b/rust/kernel/alloc/kvec.rs
@@ -7,10 +7,7 @@
layout::ArrayLayout,
AllocError, Allocator, Box, Flags, NumaNode,
};
-use crate::{
- fmt,
- page::AsPageIter,
-};
+use crate::{fmt, page::AsPageIter};
use core::{
borrow::{Borrow, BorrowMut},
marker::PhantomData,
thanks,
--
John Hubbard
Powered by blists - more mailing lists