llvm-project/clang/unittests/Format
Alex Richardson 906b9dbc9d [clang-format] Improve BAS_DontAlign+AllowAllArgumentsOnNextLine=false
TokenAnnotator::splitPenalty() was always returning 0 for opening parens if
AlignAfterOpenBracket was set to BAS_DontAlign, so the preferred point for
line breaking was always after the open paren (and was ignoring
PenaltyBreakBeforeFirstCallParameter). This change restricts the zero
penalty to the AllowAllArgumentsOnNextLine case. This results in improved
formatting for FreeBSD where we set AllowAllArgumentsOnNextLine: false
and a high value for PenaltyBreakBeforeFirstCallParameter to avoid breaking
after the open paren.

Before:
```
functionCall(
    paramA, paramB, paramC);
void functionDecl(
    int A, int B, int C)
```
After:
```
functionCall(paramA, paramB,
    paramC);
void functionDecl(int A, int B,
    int C)
```

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D90246
2020-11-02 17:52:37 +00:00
..
CMakeLists.txt [clang-format] Fix misformatted macro definitions after D86959 2020-10-27 12:16:46 +00:00
CleanupTest.cpp [clang-format] Drop clangFrontend dependency for FormatTests 2020-10-20 10:13:28 +01:00
FormatTest.cpp [clang-format] Improve BAS_DontAlign+AllowAllArgumentsOnNextLine=false 2020-11-02 17:52:37 +00:00
FormatTestCSharp.cpp [clang-format] NFC ensure the clang-format tests remain clang-formatted 2020-09-18 18:16:02 +01:00
FormatTestComments.cpp [clang-format] Drop clangFrontend dependency for FormatTests 2020-10-20 10:13:28 +01:00
FormatTestJS.cpp [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set 2020-05-15 16:40:31 +02:00
FormatTestJava.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestObjC.cpp [clang-format] Drop clangFrontend dependency for FormatTests 2020-10-20 10:13:28 +01:00
FormatTestProto.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestRawStrings.cpp [clang-format] Drop clangFrontend dependency for FormatTests 2020-10-20 10:13:28 +01:00
FormatTestSelective.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestTableGen.cpp [clang-format][TableGen] Don't add spaces around items in square braces. 2019-03-01 00:12:18 +00:00
FormatTestTextProto.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestUtils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MacroExpanderTest.cpp Fix use-after-scope introduced in 850325348a 2020-10-27 14:26:23 +00:00
NamespaceEndCommentsFixerTest.cpp [clang-format] Drop clangFrontend dependency for FormatTests 2020-10-20 10:13:28 +01:00
SortImportsTestJS.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SortImportsTestJava.cpp [clang-format] Add a option for the position of Java static import 2020-09-18 18:12:21 +01:00
SortIncludesTest.cpp [format] foo.<name>.h should be the main-header for foo.<name>.cc 2020-10-20 13:27:02 +02:00
TestLexer.h Fix use-after-scope introduced in 850325348a 2020-10-27 14:26:23 +00:00
TokenAnnotatorTest.cpp Fix use-after-scope introduced in 850325348a 2020-10-27 14:26:23 +00:00
UsingDeclarationsSorterTest.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00