clang-format: options for formatting templates

Similar to bug 25148
https://llvm.org/bugs/show_bug.cgi?id=25148

There seems to be no options for directly formatting large template declarations, instead the formatting is done mostly using the column width and associates penalties.
(An example of our preferred formatting style for templates can be seen in example1.cpp (attached), while the current output of clang-format can be seen in example2.cpp).

Is there any current options that would solve provide the formatting we require that I have overlooked please?
if not, is there anyone currently working on implementing something like this?
otherwise, I would potentially be interested in implementing something to solve this if someone can give me some guidance on where to start?
our .clang-format is attached as well for reference

I was thinking a potential solution would be adding an AlwaysBreakOnOpeningTemplate option similar to the AlignAfterOpenBracket option.

Cheers,

Matt

example.zip (1.81 KB)

Similar to bug 25148
https://llvm.org/bugs/show_bug.cgi?id=25148

There seems to be no options for directly formatting large template
declarations, instead the formatting is done mostly using the column width
and associates penalties.
(An example of our preferred formatting style for templates can be seen in
example1.cpp (attached), while the current output of clang-format can be
seen in example2.cpp).

Is there any current options that would solve provide the formatting we
require that I have overlooked please?
if not, is there anyone currently working on implementing something like
this?

I don't think so (for both questions).

otherwise, I would potentially be interested in implementing something to
solve this if someone can give me some guidance on where to start?

Sure. I need more specific questions, though. Looking at what
AlignAfterOpenBracket is doing seems to be a good starting point. Well
actually the best starting point might be to write down the exact rules
that you are trying to implement in prose and get some kind of agreement
here. Ideally you have a style guide explaining them (
http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options
).

our .clang-format is attached as well for reference

I was thinking a potential solution would be adding an
AlwaysBreakOnOpeningTemplate option similar to the AlignAfterOpenBracket
option.

Either that or even just re-use AlignAfterOpenBracket. Seems to me that
people wanting the one likely also want the other.

Cheers,
Daniel