hanchenye-llvm-project/clang/unittests/Format
Ben Hamilton 4dc658ca52 [clang-format] New format param ObjCBinPackProtocolList
Summary:
This is an alternative approach to D42014 after some
investigation by stephanemoore@ and myself.

Previously, the format parameter `BinPackParameters` controlled both
C function parameter list bin-packing and Objective-C protocol conformance
list bin-packing.

We found in the Google style, some teams were changing
`BinPackParameters` from its default (`true`) to `false` so they could
lay out Objective-C protocol conformance list items one-per-line
instead of bin-packing them into as few lines as possible.

To allow teams to use one-per-line Objective-C protocol lists without
changing bin-packing for other areas like C function parameter lists,
this diff introduces a new LibFormat parameter
`ObjCBinPackProtocolList` to control the behavior just for ObjC
protocol conformance lists.

The new parameter is an enum which defaults to `Auto` to keep the
previous behavior (delegating to `BinPackParameters`).

Depends On D42649

Test Plan: New tests added. make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, stephanemoore, djasper

Reviewed By: stephanemoore

Subscribers: Wizard, hokein, cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D42650

llvm-svn: 324131
2018-02-02 20:15:14 +00:00
..
CMakeLists.txt [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
CleanupTest.cpp clang-format: [JS] do not clean up duplicated commas. 2017-05-29 08:41:11 +00:00
FormatTest.cpp [clang-format] Align preprocessor comments with # 2018-01-31 20:05:50 +00:00
FormatTestComments.cpp Fix bug where we wouldn't break columns over the limit. 2017-12-04 08:53:16 +00:00
FormatTestJS.cpp clang-format: [JS] Prevent ASI before [ and (. 2018-01-26 15:07:49 +00:00
FormatTestJava.cpp clang-format: Support formatting Java 8 interface default methods. 2018-01-23 16:30:56 +00:00
FormatTestObjC.cpp [clang-format] New format param ObjCBinPackProtocolList 2018-02-02 20:15:14 +00:00
FormatTestProto.cpp [clang-format] Adds space around braces in text protos 2018-01-31 10:14:10 +00:00
FormatTestRawStrings.cpp [clang-format] Adds space around braces in text protos 2018-01-31 10:14:10 +00:00
FormatTestSelective.cpp [clang-format] Handle trailing comment sections in import statement lines 2017-05-19 10:34:57 +00:00
FormatTestTextProto.cpp [clang-format] Adds space around braces in text protos 2018-01-31 10:14:10 +00:00
FormatTestUtils.h clang-format: Add preprocessor directive indentation 2017-08-30 14:34:57 +00:00
NamespaceEndCommentsFixerTest.cpp clang-format: fix block OpeningLineIndex around preprocessor 2017-07-28 07:56:14 +00:00
SortImportsTestJS.cpp clang-format: [JS] support default imports. 2017-08-01 15:54:43 +00:00
SortIncludesTest.cpp [clang-format] Add option to group multiple #include blocks when sorting includes 2017-11-27 13:23:45 +00:00
UsingDeclarationsSorterTest.cpp [clang-format] Deduplicate using declarations 2017-11-24 18:00:01 +00:00