From: Ralf Lici <ralf@mandelbit.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: ojeda@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] .clang-format: avoid call wrapping that triggers OPEN_ENDED_LINE
Date: Mon, 23 Mar 2026 10:19:29 +0100 [thread overview]
Message-ID: <33fdce98-a3fa-4830-8023-53fdfcaf1644@mandelbit.com> (raw)
In-Reply-To: <CANiq72nqUa6=kz=mqp8_rHccNSgTuhh4gEvBar4HEWj9wgJsKw@mail.gmail.com>
On 3/22/26 12:06, Miguel Ojeda wrote:
> On Mon, Mar 16, 2026 at 9:29 AM Ralf Lici <ralf@mandelbit.com> wrote:
>>
>> Therefore I wanted to ask whether maintainers think this class of
>> formatting is worth addressing at all, and if so, whether there is any
>> openness to adjusting the existing cost model while keeping the current
>> clang-format compatibility expectations, or revisiting the minimum
>> supported clang-format version for .clang-format so that more specific
>> options can be used.
>
> Yeah, we can definitely use options up to the usual LLVM minimum
> (currently 15), and yeah, we can tweak things since `clang-format` is
> opt-in.
>
> Some maintainers already use `clang-format` to format full files, so
> we should be mindful of big changes; but if they are worth it, the
> sooner we do it, the better.
I tested PenaltyBreakOpenParenthesis across a few representative files,
varying the value and counting lines ending with '(' after formatting.
The results show that the value needed to suppress open-paren breaks
varies widely across files, from a few hundred (e.g. net/core/skbuff.c)
to tens of thousands (e.g. fs/ext4/super.c).
The issue is not just the scale of the option value: constructs like
TP_STRUCT__entry( use the open-paren break intentionally, as part of
their formatting structure. A global penalty cannot distinguish between
those and the cases this RFC was originally motivated by.
Therefore I will drop this approach for now, unless someone has ideas
for a more targeted solution. Sorry for the extra churn, and thanks for
the feedback.
Cheers,
--
Ralf Lici
Mandelbit Srl
prev parent reply other threads:[~2026-03-23 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 8:29 Ralf Lici
2026-03-22 11:06 ` Miguel Ojeda
2026-03-23 9:19 ` Ralf Lici [this message]
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=33fdce98-a3fa-4830-8023-53fdfcaf1644@mandelbit.com \
--to=ralf@mandelbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ojeda@kernel.org \
/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®