[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad3567301af7b1b24cf4ac447fec8d618231ea33.camel@perches.com>
Date: Fri, 04 Mar 2022 09:36:47 -0800
From: Joe Perches <joe@...ches.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Tom Rix <trix@...hat.com>
Cc: Finn Thain <fthain@...ux-m68k.org>,
Konrad Wilhelm Kleine <kkleine@...hat.com>,
Bart Van Assche <bvanassche@....org>,
kashyap.desai@...adcom.com, sumit.saxena@...adcom.com,
shivasharan.srikanteshwara@...adcom.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
megaraidlinux.pdl@...adcom.com, scsi <linux-scsi@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>, llvm@...ts.linux.dev
Subject: Re: [PATCH] scsi: megaraid: cleanup formatting of megaraid
On Fri, 2022-03-04 at 15:02 +0100, Miguel Ojeda wrote:
> On Fri, Mar 4, 2022 at 2:46 PM Tom Rix <trix@...hat.com> wrote:
> >
> > The churn level will be very high.
>
> Nobody is planning to reformat the entire kernel, at least not until
> the tool is close enough to the kernel style, which will take a while.
I rather doubt clang-format will ever be 'close enough'.
A human's sense of 'taste' for reading code is very different than
what an automated tool produces.
For instance, clang-format does a quite poor job when comments are
intermixed with definitions.
Also, try looking at the changes clang-format does on a file chosen
at random:
$ clang-format -i drivers/hid/hid-sony.c
$ git diff drivers/hid/hid-sony.c
[...]
o columnarized definitions -> not columnarized
o odd line continuation placement using spaces and not tabs before \
o odd array definition layouts
o per line definitions with comments poorly laid out
o individual line definitions rewrapped
o enum definitions on multiple lines compressed to single lines
o u8 array definition layouts where the first element has a separate
meaning than the subsequent elements are compressed and made
difficult to understand
I think _some_ clang-format output is ok, but the concept of
enabling/disabling specific reformatting bits would be quite useful.
And sprinkling "clang-format on/off" lines in the code is not good.
Any control codes that determine when source code layout might be
immutable or allowed to be modified could be should be tool name
agnostic.
Powered by blists - more mailing lists