Re: [RFC PATCH] .clang-format: Remove conditional comments

From: Nick Desaulniers
Date: Tue Nov 03 2020 - 20:08:27 EST


On Tue, Nov 3, 2020 at 1:33 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> Hi Joe,
>
> On Tue, Nov 3, 2020 at 7:29 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
> >
> > Now that the clang minimum supported version is > 10.0, enable the
> > commented out conditional reformatting key:value lines in the file.
> >
> > Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> > ---
> >
> > Hey Miguel.
> >
> > I don't use this, but on its face it seems a reasonable change
> > if the commented out key:value lines are correct.

Joe,
what would it take to get you to use clang-format, or at least try it?
Beers? Bribes? Dirty deeds, done dirt cheap?

> It is, yeah; however, the concern is that there may be developers
> running an old clang-format from their distro (i.e. not using it for
> compiling the kernel). We need to compare the functionality advantage
> vs. the inconvenience of installing a current LLVM. The best would be
> to ask whoever is using it right now, but there is no easy way to do
> that -- many will only notice when the change is actually pushed :-)
>
> So far, I have avoided upgrading the requirement until clang-format
> could match the kernel style even better (i.e. so that when the
> upgrade happens, there is a reason for it). Also, the configuration
> can be overridden in subfolders, thus a maintainer can push things
> forward in a subsystem meanwhile.

Miguel,
Really? :P I'd bet if you picked up this patch no one would notice.

I recommend a simpler approach to multiple version support, which is
just matching the one version recommended for the rest of LLVM tools.
Sure, technically you can use older tools, but do so at your own peril
and don't complain to us if it doesn't work. Otherwise trying to
explain different versions and even for different directories gets way
too complex for anyone to take seriously. It's not like we backport
raising the minimum version.

I was very much in denial of committing to a relatively high minimum
version of LLVM myself, until Linus recommended the simpler approach
which folks voted in favor of at Plumbers. Maybe not a perfect
analogy though.
--
Thanks,
~Nick Desaulniers