<div dir="ltr">I don't think you can, clang-format tries to support the most common styles well, not every conceivable style :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 4, 2016 at 3:30 AM, phi clang via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@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"><div dir="ltr"><div><div><div><div><div>Hi All,<br><br></div>learning curve is steep :)<br><br></div>From<br>CX08$ more c1.c<br>struct yo {<br>int i;<br>int j;<br>};<br><br>int f(int i, int j)<br>{ if(i){i++;} else {j++;}<br> return(i+j);<br>}<br><br></div>I'd like to get <br>CX08$ more c1.c<br>struct yo <br>{ int i;<br> int j;<br>};<br><br>int f(int i, int j)<br>{ if(i)<br> { i++;<br> }<br> else<br> { j++;<br> return(i+j);<br> }<br>}<br><br><br></div>I found BreakBeforeBraces Allman about ok but has an extra line I don't want<br><br>CX08$ /home/phi/llvmbuild/bin/clang-format c.c<br>struct yo<br></div>{ <----- don't want this \n<br><div> int i;<br> int j;<br>};<br><br>int f(int i, int j)<br>{<----- don't want this \n<br> if (i)<br> {<----- don't want this \n<br> i++;<br> }<br> else<br> {<----- don't want this \n<br> j++;<br> }<br> return (i + j);<br>}<br><br><br></div><div>Any ideas how to tweak .clang-format <br><br></div><div>Try and fail on all option is a bit slow :)<br><br><br></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>