[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4ouf5EuNoS779ZjCw4RzgHz2w3HbZOsCKQ2_DvpXdyMoqsw@mail.gmail.com>
Date: Wed, 14 Jun 2023 13:33:52 +0200
From: Íñigo Huguet <ihuguet@...hat.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Jonathan Corbet <corbet@....net>, ojeda@...nel.org,
danny@...ag0n.dev, masahiroy@...nel.org, jgg@...dia.com,
mic@...ikod.net, linux-kernel@...r.kernel.org, joe@...ches.com,
linux@...musvillemoes.dk, willy@...radead.org,
mailhol.vincent@...adoo.fr
Subject: Re: [PATCH v4] Add .editorconfig file for basic formatting
On Fri, Jun 9, 2023 at 12:49 PM Miguel Ojeda
<miguel.ojeda.sandonis@...il.com> wrote:
>
> On Fri, Jun 9, 2023 at 10:49 AM Íñigo Huguet <ihuguet@...hat.com> wrote:
> >
> > This is a valid option, indeed, but In my opinion we are overlooking this.
> >
> > Adding an .editorconfig will not silently reconfigure the editors of
> > everyone because for most editors you need to install a plugin to use
> > it. In my opinion, that's enough "opt-in". Here is the list of editors
> > that have built-in support, and those that need a plugin install. I
> > don't think that those with built-in support are widely used for
> > kernel development, and many of them allow to disable the feature.
>
> It is true that some of the big ones (Emacs, Vim, VS Code...) do not,
> but e.g. NeoVim and Kate (`KTextEditor`) both seem to support it, and
> those are used by some kernel developers. In particular, NeoVim says
> it enables it by default, if I am reading correctly.
>
> But perhaps those two behave as we want.
As I can see, NeoVim allows to disable it, which is good enough for
me, but Kate doesn't.
>
> > I see this as the exact same case as adding a .clang-format file, as
> > we already have. Some editors, either built-in or via plugin,
> > automatically reformat code when this file is present. And it's far
> > more "intrusive" than editorconfig.
>
> I do not recall any complaints about code getting reformatted
> automatically -- which editors are you referring to? (i.e. that
> natively reformat the code, in its default configuration).
Maybe not in default configuration, but people might have it enabled
in their editors anyway, so suddenly appearing a .clangformat in the
repo could cause it. My point is that this is a very similar case.
> In any case, it was a slightly more constrained case: `clang-format`
> (and LLVM/Clang) needed to be installed with a new enough version,
> which may not have been too common back then, and it ""only"" applied
> to C code.
>
> Cheers,
> Miguel
>
--
Íñigo Huguet
Powered by blists - more mailing lists