Git cl format sorting includes wrongly |
|||
Issue description
I ran git cl format in an ongoing CL and got the change below where it in fact reordered includes in a content/ file non-alphabetically:
> git add -u && git cl format && git diff
diff --git a/content/browser/frame_host/mixed_content_navigation_throttle_unittest.cc b/content/browser/frame_host/mixed_content_navigation_throttle_unittest.cc
index cd622212ecb7..60ad4ae9b1cf 100644
--- a/content/browser/frame_host/mixed_content_navigation_throttle_unittest.cc
+++ b/content/browser/frame_host/mixed_content_navigation_throttle_unittest.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/macros.h"
#include "content/browser/frame_host/mixed_content_navigation_throttle.h"
+#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
,
Feb 11 2017
This is because of the "primary header should be at the top of the list of includes" rule. For example, see the ordering in //base/bind_unittest.cc, which tests //base/bind.h: https://cs.chromium.org/chromium/src/base/bind_unittest.cc?rcl=bfb6d62e98fe74682a7a0c81444b8f837bb48350&l=5
,
Feb 12 2017
(ideally put a newline after that first line too)
,
Feb 12 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by carlosk@chromium.org
, Feb 11 2017