[PATCH] D12921: clang-format: Support 'template<>' (no space).

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 06:52:50 PDT 2015


On Thu, Sep 17, 2015 at 12:17 PM, Paul Hoad <mydeveloperday at gmail.com>
wrote:

> MyDeveloperDay added a comment.
>
> > The point here that it this space is utterly irrelevant
>
>
> So I totally take the point but if it doesn't matter then why does
> clang-format automatically add one to my "template<>" why not simply leave
> it alone?
>

Because that is something else clang-format (almost) never does.
Consistency is beneficial.

> We never intended clang-format to provide control over every aspect of
> formatting
>
>
> I know that when new people come along on an open source project they want
> to change the world, for that I apologize, we weren't here for the previous
> decisions, but maybe clang-format is turning into something that is
> different from what was originally intended, maybe it CAN become the code
> formatting tool for those teams out there that are not quite/can't  do it
> the google way.
>

I generally agree and will gladly accept any useful formatting option. I
know I have been slow at reviewing your patches and I am sorry about that.
I was on vacation and had to catch on other stuff, but I hope we can make
progress on those.

> We'd rather have it support a limited set of (important) style options
> really well
>
>
> And that I understand, but for those of us whose style does not exactly
> meet one of the 5 what can WE do other than submit patches to give finer
> control.
>

One of the 5?? Clang-format has *many* options by now and supports many
large open-source projects and publicly available style guides. I have
personally spent a lot of time on and implemented many options that are
entirely irrelevant to both Google and LLVM.

And whether or not to add the space is something that nobody really had an
opinion. Basically every project I sampled was inconsistent, not a single
style guide said what to do. We looked around at the sources we could find
(the style guide most heavily) and made a decision. If you had brought up
good arguments that the space hurts readability (I really doubt it), you
could have made us turn the other way. The point is that this space matter
so little that it is not worth having the option.

I don't want to argue but I would like you (who seems to be the gatekeeper
> for clang-format) to consider.
>

I have considered and my opinion stands. It is not worth having this option
and it is also not worth changing that clang-format adds the space now that
it has been in use by many for 2+ years.

I am sorry if this means you cannot use clang-format for a significant
project.

http://reviews.llvm.org/D12921
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150917/d90068de/attachment-0001.html>


More information about the cfe-commits mailing list