From: Joe Perches <joe@perches.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Tom Rix <trix@redhat.com>, Finn Thain <fthain@linux-m68k.org>,
Konrad Wilhelm Kleine <kkleine@redhat.com>,
Bart Van Assche <bvanassche@acm.org>,
kashyap.desai@broadcom.com, sumit.saxena@broadcom.com,
shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
megaraidlinux.pdl@broadcom.com, scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
llvm@lists.linux.dev
Subject: Re: [PATCH] scsi: megaraid: cleanup formatting of megaraid
Date: Fri, 04 Mar 2022 11:28:31 -0800 [thread overview]
Message-ID: <451bb2c394b05928c815f1eb349a1281a687a608.camel@perches.com> (raw)
In-Reply-To: <CANiq72kWJtOTmcXNO+t4NY22v6xM49Z-U2aSB4apNd96PYbD4Q@mail.gmail.com>
On Fri, 2022-03-04 at 19:48 +0100, Miguel Ojeda wrote:
> On Fri, Mar 4, 2022 at 6:37 PM Joe Perches <joe@perches.com> wrote:
> >
> > 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.
>
> Maybe,
Hey again Miguel.
Is that statement really disputable?
> but it is a trade-off. If it is close enough, the benefits of
> automatic formatting may overcome the downsides.
IYO. I think using an SCCS with better language understanding rather
than a line oriented one could be an improvement. Such a tool could
allow arbitrary style reformatting at check-in/check-out.
> > Also, try looking at the changes clang-format does on a file chosen
> > at random:
> >
> > 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 am not sure what you are trying to show here -- some of these are
> precisely the things that the tool could improve or have already
> improved, and we may just need to use the new option.
All of these existing code are more human readable than the code
reformatted using clang-format.
I used whatever is the latest clang-format here with today's -next.
https://releases.llvm.org/download.html
> For instance, for the columnarized macros case, it is possible to
> align them since clang-format 9. For array of structures, there is
> also a new alignment option since clang-format 13. Etc.
Then perhaps you as the maintainer of the kernel's .clang-format file
could update the entries for those new options.
I believe the minimum clang version is already 11. Maybe higher.
I don't track clang or use it very much. The clang version I use
though is 13.
> For the wrapping and related bits, now that the limit on 80 is a bit
> more fuzzy, we could perhaps tweak the penalties to improve the
> decision making.
Please have at it.
But perhaps tweaking will just improve some cases and worsen others.
> In summary, what we should be trying to do is improve the tool
> configuration and tool itself to see if we can get it to be close
> enough to the kernel style to make it more widely used.
>
> > 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.
>
> Definitely, but it is fine in some exceptional cases.
I don't think so.
> > Any control codes that determine when source code layout might be
> > immutable or allowed to be modified could be should be tool name
> > agnostic.
>
> I don't see why would that be a problem, and I don't understand why we
> would use several different formatting tools (the point is to be
> consistent, after all); but sure, we could propose an alternative
> spelling.
Thanks.
There is no "one true editor".
There will not be "one true source code formatter" either.
cheers not jeers, just keep at it. Joe
next prev parent reply other threads:[~2022-03-04 20:16 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 15:19 trix
2022-01-27 22:37 ` Finn Thain
2022-01-27 22:47 ` Nick Desaulniers
2022-01-28 0:32 ` Tom Rix
2022-01-28 2:43 ` Joe Perches
2022-01-28 5:31 ` Tom Rix
2022-01-28 8:41 ` Joe Perches
2022-01-28 15:30 ` Tom Rix
2022-01-28 16:23 ` Joe Perches
2022-01-28 23:45 ` Finn Thain
2022-01-28 9:39 ` Miguel Ojeda
2022-01-28 17:42 ` Bart Van Assche
2022-01-28 17:59 ` Tom Rix
2022-01-28 19:11 ` Joe Perches
2022-01-28 19:37 ` Tom Rix
2022-03-02 19:14 ` Tom Rix
2022-03-03 8:35 ` Finn Thain
2022-03-03 11:41 ` Konrad Wilhelm Kleine
[not found] ` <CABRYuGk+1AGpvfkR7=LTCm+bN4kt55fwQnQXCjidSXWxuMWsiQ@mail.gmail.com>
2022-03-03 22:44 ` Finn Thain
2022-03-03 23:17 ` Miguel Ojeda
2022-03-03 23:38 ` Joe Perches
2022-03-04 5:22 ` Bart Van Assche
2022-03-04 5:40 ` Joe Perches
2022-03-05 3:22 ` Finn Thain
2022-03-04 7:47 ` Finn Thain
2022-03-04 12:31 ` Miguel Ojeda
2022-03-04 13:46 ` Tom Rix
2022-03-04 14:02 ` Miguel Ojeda
2022-03-04 17:36 ` Joe Perches
2022-03-04 18:48 ` Miguel Ojeda
2022-03-04 19:28 ` Joe Perches [this message]
2022-03-04 21:04 ` Miguel Ojeda
2022-03-05 3:32 ` Finn Thain
2022-03-04 22:38 ` Tom Rix
2022-01-28 20:30 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=451bb2c394b05928c815f1eb349a1281a687a608.camel@perches.com \
--to=joe@perches.com \
--cc=bvanassche@acm.org \
--cc=fthain@linux-m68k.org \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=kkleine@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=martin.petersen@oracle.com \
--cc=megaraidlinux.pdl@broadcom.com \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=shivasharan.srikanteshwara@broadcom.com \
--cc=sumit.saxena@broadcom.com \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®