mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Joe Perches <joe@perches.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clang-format: Update .clang-format with the latest for_each macro list
Date: Mon, 21 Jan 2019 01:59:03 +0000	[thread overview]
Message-ID: <20190121015855.GD18031@mellanox.com> (raw)
In-Reply-To: <CANiq72md_UVj2ZYXhmnqK29CNvCOdwOHU0Gfy-Kr50hNDJ7rXg@mail.gmail.com>

On Sat, Jan 19, 2019 at 10:29:50PM +0100, Miguel Ojeda wrote:
> Hi Joe,
> 
> On Sat, Jan 19, 2019 at 8:45 PM Joe Perches <joe@perches.com> wrote:
> >
> > I suggest clang-format's ForEachMacros statement vector
> > be expanded to support regexes ala
> >
> > ForEachMacros:
> >   - Regex:           '\b(?:(?:[a-z0-9_]+_)?for_each(?:_[a-z_]+)|[a-z0-9_]+_for_each)\b'
> 
> Ah, yeah, of course. And it should be easy, because there is already
> support for regexes in the IncludeCategories option. However, the
> configuration file was intended for clang-format >= 4 (when I added
> the file, the intention was to make it usable as easily as possible,
> i.e. taking into account the availability of clang-format in distros).
> 
> Actually, if we were to change clang-format and then require in the
> kernel the latest release, we could go a bit further and add the
> missing features needed to match the kernel style almost completely. I
> have been trying to allocate some time to start that project in my
> backlog, but... :-)

It is unfortunate that clang format does not have a way for old
versions to parse new .clang-format files.

Perhaps the best course is to get that ability and then go ahead and
bump the min required version to there.. Otherwise this is a never
ending upgrade treadmill.

ie if clang-format would look for a .clang-format.VERSION first and
then try for the generic we could at least have a (somewhat painful)
path.. Or if it would run it through cpp first we could use
#ifdef/etc.

Jason

      reply	other threads:[~2019-01-21  7:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 22:57 Jason Gunthorpe
2019-01-19 18:30 ` Miguel Ojeda
2019-01-19 19:06   ` Joe Perches
2019-01-19 19:32     ` Miguel Ojeda
2019-01-19 19:45       ` Joe Perches
2019-01-19 21:29         ` Miguel Ojeda
2019-01-21  1:59           ` Jason Gunthorpe [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=20190121015855.GD18031@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.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

Powered by JetHome