> On Feb 24, 2015, at 8:23 PM, Leif Hedstrom <zw...@apache.org> wrote:
> 
>> 
>> On Feb 24, 2015, at 8:04 PM, Phil Sorber <sor...@apache.org> wrote:
>> 
>> On Tue Feb 24 2015 at 7:36:51 PM Leif Hedstrom <zw...@apache.org> wrote:
>> 
>>> 
>>>> On Feb 24, 2015, at 5:30 PM, Bryan Call <bc...@apache.org> wrote:
>>>> 
>>>> It would be good to see how well it does on formatting before agreeing
>>> 
>>> 
>> This link might help:
>> https://github.com/zwoop/trafficserver/compare/clang-format
>> 
>> We should make lines longer so as to avoid things like:
>> https://github.com/zwoop/trafficserver/compare/clang-format#diff-772cdf9b526f76c710242c7c05047503L286
> 
> 
> Thanks James and Phil for spotting a bunch of anomalies. I hope we can 
> address many / most of those with clang-format config changes, but definitely 
> not all. I’m ok with changing our indentation style, but not sure how the 
> logistics for that will fit in with a 5.3.0 branching this week? There are as 
> many indentation style preferences as we have developers, it’ll take us a 
> long time to get consensus :).
> 
> This particularly malfunction looks like a bug in clang-format though, I 
> don’t think increasing the line length will necessarily help (but it might). 
> There was another case brought up by James, where clang-format gets crippled 
> because someone has already violated the line length requirements (< 120) 
> severely, putting insanely long comments at the end of lines.


Per Phil’s inspired suggestions, I made a small hand edit of these particular 
lines, merging those two strings into one. There’s no reason why they have to 
be two strings like that, probably some old legacy indentation style would be 
my guess. Doing this “hand fix” resolves the issue, and lets clang-format 
indent it properly, i.e. http://pastebin.com/DtGEmzr6

So, I don’t expect this will be without pain. There will be cases where we have 
made some really poor formatting and indentation choices, and we’ll have to do 
a little bit of handwaving. It’s important though that we should be able to run 
“clang-format” at any give time on master, and there should be little or not 
changes. Of course, while working on code, and discovering anomalies like the 
one above, the commit should include the necessary fixes to let clang-format 
function.

Daniel Gruno: James suggested running clang-format as a git hook on the server. 
Is that a possibility at all?

— Leif

Reply via email to