New issue
Advanced search Search tips

Issue 691155 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Git cl format sorting includes wrongly

Project Member Reported by carlosk@chromium.org, Feb 11 2017

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 {



 
Note: without the out-of-order modification above pre-submit checks do fail.

Comment 2 by dcheng@chromium.org, Feb 11 2017

Status: WontFix (was: Untriaged)
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

Comment 3 by thakis@chromium.org, Feb 12 2017

(ideally put a newline after that first line too)

Comment 4 by thakis@chromium.org, Feb 12 2017

Labels: clang-format

Sign in to add a comment