<div dir="ltr">Hello everyone,<div><br></div><div>I'm using clang-format to reformat and improve the readability of a quite large codebase. </div><div>I've written my .clang_format and everything is going fine on .cc files. However, I've some trouble formatting my header files. </div><div><br></div><div>In codebase, when headers are properly formatted, there are looking like this :</div><div><pre style=""><pre style="font-family:"JetBrains Mono",monospace;background-color:rgb(43,43,43);color:rgb(169,183,198)"><span style="color:rgb(204,120,50)">int </span><span style="color:rgb(255,198,109)">shortFunc </span>(<span style="color:rgb(204,120,50)">int</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">unsigned long long </span><span style="color:rgb(255,198,109)">shortFunc2 </span>(<span style="color:rgb(204,120,50)">int</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">int </span><span style="color:rgb(255,198,109)">looooooonnnnnnnnngggggggggFunctioooonnnnnNaaaammmmeeee </span>(<span style="color:rgb(204,120,50)">int, int, int</span>)<span style="color:rgb(204,120,50)">;
</span></pre><pre style=""><font face="arial, sans-serif">I'd like to keep the alignment on parentheses in header files. However, the best I achieve with clang-format is this result :</font></pre><pre style=""><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace"><span style="color:rgb(204,120,50)">int </span><span style="color:rgb(255,198,109)">shortFunc</span>(<span style="color:rgb(204,120,50)">int</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">unsigned long long </span><span style="color:rgb(255,198,109)">shortFunc2</span>(<span style="color:rgb(204,120,50)">int</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">int </span><span style="color:rgb(255,198,109)">looooooonnnnnnnnngggggggggFunctioooonnnnnNaaaammmmeeee</span>(<span style="color:rgb(204,120,50)">int, int, int</span>)<span style="color:rgb(204,120,50)">;<br></span></pre><font face="arial, sans-serif">Here are my questions:</font></pre><pre style=""><font face="arial, sans-serif">1) Do you know if I can achieve this format (alignment on function names and on parentheses) in header files with clang-format?</font></pre><pre style=""><font face="arial, sans-serif">2) If it is not possible, would it be possible for me to contribute to clang-format in order to add this feature ? </font></pre><pre style=""><font face="arial, sans-serif">I hope I'm writing on the right mailing list :) </font></pre><pre style=""><font face="arial, sans-serif">Have a nice week,</font></pre><pre style=""><font face="arial, sans-serif">Thomas </font></pre><pre style=""><font face="arial, sans-serif"><br></font></pre><pre style=""><font face="arial, sans-serif"> </font></pre><pre style=""><font face="arial, sans-serif"><br></font></pre><pre style=""><font face="arial, sans-serif"><br></font></pre></pre></div></div>