<div dir="ltr">+Daniel Jasper, one of the clang-format developers<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 8, 2016 at 12:13 AM, Felix Mauch via cfe-users <span dir="ltr"><<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I recently stumbled across clang-format and I really like it so far :)<br>
However, I was not able to reproduce some of our csg guidelines. </blockquote><div><br></div><div>(not familiar with 'csg' here)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe I was too stupid configuring this, but as far as I can see those things are not working atm (I am using version 3.6), am I right?<br></blockquote><div><br></div><div>Possible formatting options are added on an as-needed and as-justified basis. The complexity of the tool could grow out of control if any/every possible formatting option were added, so I believe the general policy is that only formatting options that are used in a large open source project or otherwise published coding standard are supported. Are the formatting options you're interested in used (not necessarily by yourself, mind you) in either such situation?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
1. Spacing around operator function definitions<br>
At my company we like to ad spaces around the operators when defining operator functions, for example:<br>
<br>
// Note the spaces around '==':<br>
bool operator == (const Type& other) const<br>
{<br>
  return (m_member == other.m_member);<br>
}<br>
<br>
I could not find anything handling this kind of stuff in clang-format. I also gave it a shot to quickly grep through the sourcecode, but couldn't find anything either. Is this simply not possible? What would be the starting point for implementing this?<br>
<br>
2. Initializer lists each in one line, comma at the end<br>
I wasn't able to reproduce this. Either everything was in a separate line, with the comma aligned to the colon, or if possible the initializer list was wrapped into one line. I agree, that the comma-colon-aligning makes sense, however it does not fit our csg ;)<br>
Is it possible to force putting every member into a separate line but keeping the comma at the end?<br>
<br>
Cheers<br>
Felix<br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div><br></div></div>