All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Oleksandr Andrushchenko <andr2000@gmail.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Artem Mygaiev <Artem_Mygaiev@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: Coding Style Review and Automation
Date: Tue, 11 Feb 2025 11:26:21 +0100	[thread overview]
Message-ID: <Z6slzXnBALUyZj1f@macbook.local> (raw)
In-Reply-To: <904D5489-29C7-4377-B50C-CED2F13A7D35@arm.com>

On Tue, Feb 11, 2025 at 09:49:54AM +0000, Luca Fancellu wrote:
> Hi Roger,
> 
> >>>> 
> >>>> 5) You name it. I think many people in the community can name their points for
> >>>> and against clang-format.
> >>> 
> >>> What are the parts of our coding style that clang-format cannot
> >>> correctly represent?  Could you make a list of what would need to
> >>> change in Xen coding style for it to match perfectly what clang-format
> >>> will check?
> >> 
> >> we already went through that route, there is no checker anywhere that matches
> >> the Xen coding style perfectly, so it’s either we change the coding style or we
> >> don’t proceed further with any automatic check
> > 
> > I'm probably fine with changing coding style, that's why I'm asking
> > for a list of what needs to be changed (unless we switch to a
> > completely different coding style).
> 
> Sure, I think listing the differences is fine.
> 
> > 
> >>> 
> >>> Ideally the first step would be to prepare a patch to adjust the
> >>> coding style so it's in line with what clang-format will do.
> >> 
> >> It’s easy to say that, but difficult to implement, if we could accept the clang-format
> >> rules it would be easier to adopt the configuration itself as coding style, maybe
> >> enhanced with some comments.
> > 
> > I'm kind of lost, why is it difficult to implement?  What I'm asking
> > for is a patch to CODING_STYLE that modifies it in a way that we could
> > use clang-format.  In any case we need to do that if we want to use
> > clang-format.
> 
> Changes to the CODING_STYLE are historically difficult, given that the natural
> language is prone to interpretation. I’m not opposing to that, I’m just pointing out that
> starting changing the CODING_STYLE in order to accept the clang-format feels
> more risky and time consuming than testing clang-format and modifying the
> CODING_STYLE accordingly.

I suggested that because it's IMO important to see the resulting
style.  I'm not suggesting to modify CODING_STYLE in a single change,
it should be multiple patches that adjust the different areas that
require changes to match what clang-format can do.

I think it's important that we can see how the final style will look
like, otherwise it's hard to compromise on intermediate seemingly
unconnected changes without knowing what the end result will be.

> Anyway the resulting clang-format would have our coding style for what can be covered
> by the tool and have something new for what it cannot be covered, it’s just that at least
> you have a reproducible way that can be tested.
> 
> > 
> > One question that seems to have been dropped from my previous email:
> > would it be feasible to apply the updated style to newly added chunks
> > of code only, but not to the (unmodified) surrounding context?
> 
> I dropped that one from my reply because I know there are tools that do that,
> but I’ve never investigated, maybe Oleksandr could try to have a look.
> 
> I’m not sure if the result would feel more like a frankenstein, but it would for sure
> limit the churn.

Depends on how many differences there are between our current coding
style and what clang-format can enforce that's closer to our existing
style.

Knowing the differences would be key in understanding whether this
would be a viable approach.  It would certainly be my preference if
the differences between our coding style and what clang-format can do
are not too big.

Thanks, Roger.


  reply	other threads:[~2025-02-11 10:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 21:16 Coding Style Review and Automation Oleksandr Andrushchenko
2025-02-11  1:37 ` Stefano Stabellini
2025-02-11  9:01 ` Roger Pau Monné
2025-02-11  9:10   ` Luca Fancellu
2025-02-11  9:31     ` Roger Pau Monné
2025-02-11  9:49       ` Luca Fancellu
2025-02-11 10:26         ` Roger Pau Monné [this message]
2025-02-11 10:30           ` Jan Beulich
2025-02-11 11:03       ` Anthony PERARD
2025-02-11 10:19     ` Jan Beulich
2025-02-11 14:06       ` Roger Pau Monné
2025-02-11 18:54         ` Marek Marczykowski-Górecki
2025-02-12 11:54           ` Edwin Torok
2025-02-11 10:14   ` Jan Beulich
2025-02-11 10:35     ` Roger Pau Monné
2025-02-11 10:28 ` Jan Beulich
2025-02-11 22:33 ` Stefano Stabellini
2025-02-12  9:14   ` Roger Pau Monné
2025-02-12 11:14     ` Grygorii Strashko
2025-02-12 11:31       ` Roger Pau Monné
2025-02-13  6:43       ` Oleksandr Andrushchenko
2025-02-12 20:03   ` Oleksandr Andrushchenko

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=Z6slzXnBALUyZj1f@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=Artem_Mygaiev@epam.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=andr2000@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.