[lkml]   [2019]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] clang-format: Update .clang-format with the latest for_each macro list
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 <> 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


 \ /
  Last update: 2019-01-21 08:14    [W:0.045 / U:5.720 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site