New issue
Advanced search Search tips

Issue 721767 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 710164
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Clang format doesn't add empty line when moving header matching .cc to top of file

Project Member Reported by gab@chromium.org, May 12 2017

Issue description

i.e. if you 

git cl format -- bar/foo.cc

bar/foo.cc:

#include "arc/a.h"
#include "base/foo.h"
#include "baz/b.h"

it will correctly move foo.h to the top but without an empty line:

Actual:
#include "bar/foo.h"
#include "arc/a.h"
#include "baz/b.h"

Expected:
#include "bar/foo.h"

#include "arc/a.h"
#include "baz/b.h"

Concrete example @ https://codereview.chromium.org/2876013002/diff/60001/chrome/browser/chromeos/input_method/textinput_test_helper.cc

The codebase already has code that landed with that incorrect formatting.
 

Comment 1 by thakis@chromium.org, May 12 2017

Mergedinto: 710164
Status: Duplicate (was: Assigned)
See response in dupe. clang-format only reorders in blocks, it's still on you to create blocks correctly.

The codebase had code looking like this before clang-format existed, so it's not 100% due to clang-format.

Sign in to add a comment