git cl format doesn't insert newlines in some cases |
|
Issue descriptionIn file foo_unittest.cc if I have: #include "bar.h" #include "foo.h" Then git cl format reorders imports to: #include "foo.h" #include "bar.h" There should be a newline between those two lines, e.g.: #include "foo.h" #include "bar.h"
,
Apr 11 2017
,
May 12 2017
,
May 12 2017
Can we turn that feature (bubbling main header to top) off in the meantime though? When mass refactoring it's uglier to end up with the main header on top of the block but not separate than to leave it in the state it was...
,
May 12 2017
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes doesn't say anything about a newline, while it does mention putting the main .h first (to ensure it's stand-alone). So I think the current behavior is better than not bubbling the main header to the top.
,
May 12 2017
I.e. the reasons for bubbling aren't just stylistic but also technical.
,
May 12 2017
Got it, so in the meantime then, we won't bother adding a newline in mass refactors that make this automatic move as that's just tedious and mostly a waste of engineering time.
,
May 12 2017
Yup, makes sense :-) |
|
►
Sign in to add a comment |
|
Comment 1 by thakis@chromium.org
, Apr 11 2017