diff options
author | Eric Liu <ioeric@google.com> | 2019-04-03 09:25:16 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2019-04-03 09:25:16 +0000 |
commit | 62e3198c4f5490a1c60ba51d81fe2e1f0dc99135 (patch) | |
tree | 5b251d29da0d3cfa990e5a8338f24a2d51e270f9 /lib/Format | |
parent | 016ad92bb982b8f631f0fdd3b02c75f04b8ddf39 (diff) |
[clang-format] Regroup #includes into blocks for Google style
Summary:
Regrouping #includes in blocks separated by blank lines when sorting C++ #include
headers was implemented recently, and it has been preferred in Google's C++ style guide:
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
Reviewers: sammccall, klimek
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60116
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format')
-rw-r--r-- | lib/Format/Format.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 119be9fae6..4dee599fe0 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -784,6 +784,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { GoogleStyle.IncludeStyle.IncludeCategories = { {"^<ext/.*\\.h>", 2}, {"^<.*\\.h>", 1}, {"^<.*", 2}, {".*", 3}}; GoogleStyle.IncludeStyle.IncludeIsMainRegex = "([-_](test|unittest))?$"; + GoogleStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Regroup; GoogleStyle.IndentCaseLabels = true; GoogleStyle.KeepEmptyLinesAtTheStartOfBlocks = false; GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never; |