[PATCH] D91602: [clang-tidy] Make clang-format and include-order-check coherent

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 05:54:23 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5a9f3867046c: [clang-tidy] Make clang-format and include-order-check coherent (authored by kadircet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91602/new/

https://reviews.llvm.org/D91602

Files:
  clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
  clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/gmock/foo.h
  clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp


Index: clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp
@@ -3,6 +3,7 @@
 // CHECK-MESSAGES: [[@LINE+2]]:1: warning: #includes are not sorted properly
 #include "j.h"
 #include "gtest/foo.h"
+#include "gmock/foo.h"
 #include "i.h"
 #include <s.h>
 #include "llvm/a.h"
@@ -16,6 +17,7 @@
 // CHECK-FIXES-NEXT: #include "clang/b.h"
 // CHECK-FIXES-NEXT: #include "llvm-c/d.h" // -c
 // CHECK-FIXES-NEXT: #include "llvm/a.h"
+// CHECK-FIXES-NEXT: #include "gmock/foo.h"
 // CHECK-FIXES-NEXT: #include "gtest/foo.h"
 // CHECK-FIXES-NEXT: #include <s.h>
 
Index: clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
+++ clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
@@ -67,7 +67,8 @@
     return 2;
 
   // System headers are sorted to the end.
-  if (IsAngled || Filename.startswith("gtest/"))
+  if (IsAngled || Filename.startswith("gtest/") ||
+      Filename.startswith("gmock/"))
     return 3;
 
   // Other headers are inserted between the main module header and LLVM headers.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91602.305762.patch
Type: text/x-patch
Size: 1343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201117/7dd758fe/attachment.bin>


More information about the cfe-commits mailing list