r324553 - [clang-format] Set ObjCBinPackProtocolList to Never for google style
Ben Hamilton via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 7 17:49:10 PST 2018
Author: benhamilton
Date: Wed Feb 7 17:49:10 2018
New Revision: 324553
URL: http://llvm.org/viewvc/llvm-project?rev=324553&view=rev
Log:
[clang-format] Set ObjCBinPackProtocolList to Never for google style
Summary:
This is split off from D42650, and sets ObjCBinPackProtocolList
to Never for the google style.
Depends On D42650
Test Plan: New tests added. make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: krasimir, jolesiak, stephanemoore
Reviewed By: krasimir, jolesiak, stephanemoore
Subscribers: klimek, cfe-commits, hokein, Wizard
Differential Revision: https://reviews.llvm.org/D42708
Modified:
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/unittests/Format/FormatTestObjC.cpp
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=324553&r1=324552&r2=324553&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Wed Feb 7 17:49:10 2018
@@ -710,6 +710,7 @@ FormatStyle getGoogleStyle(FormatStyle::
GoogleStyle.IncludeIsMainRegex = "([-_](test|unittest))?$";
GoogleStyle.IndentCaseLabels = true;
GoogleStyle.KeepEmptyLinesAtTheStartOfBlocks = false;
+ GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never;
GoogleStyle.ObjCSpaceAfterProperty = false;
GoogleStyle.ObjCSpaceBeforeProtocolList = true;
GoogleStyle.PointerAlignment = FormatStyle::PAS_Left;
Modified: cfe/trunk/unittests/Format/FormatTestObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTestObjC.cpp?rev=324553&r1=324552&r2=324553&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTestObjC.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTestObjC.cpp Wed Feb 7 17:49:10 2018
@@ -333,13 +333,16 @@ TEST_F(FormatTestObjC, FormatObjCInterfa
verifyFormat("@interface Foo (HackStuff) <MyProtocol>\n"
"+ (id)init;\n"
"@end");
- Style.BinPackParameters = false;
- Style.ColumnLimit = 80;
- verifyFormat("@interface aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa () <\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
- " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> {\n"
+ Style.ColumnLimit = 40;
+ // BinPackParameters should be true by default.
+ verifyFormat("void eeeeeeee(int eeeee, int eeeee,\n"
+ " int eeeee, int eeeee);\n");
+ // ObjCBinPackProtocolList should be BPS_Never by default.
+ verifyFormat("@interface fffffffffffff () <\n"
+ " fffffffffffff,\n"
+ " fffffffffffff,\n"
+ " fffffffffffff,\n"
+ " fffffffffffff> {\n"
"}");
}
More information about the cfe-commits
mailing list