From 60d18176ef4307acebff96048197997fd73e5988 Mon Sep 17 00:00:00 2001 From: John Beard Date: Sun, 18 May 2025 22:28:33 +0800 Subject: [PATCH] Clang-format: better match code policy example for constructors AllowAllConstructorInitializersOnNextLine and ConstructorInitializerAllOnOneLineOrOnePerLine are both deprecated. PackConstructorInitializers=Never is the most similar setting to most code and the example in the policy document. E.g. this does not get reformatted: STRINGFORMATTER( int aReserve = 300 ) : buffer( aReserve, '\0' ) { } --- _clang-format | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_clang-format b/_clang-format index e052fa289f..2ee2e10709 100644 --- a/_clang-format +++ b/_clang-format @@ -6,7 +6,6 @@ AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: true AlignOperands: true AlignTrailingComments: true -AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: true @@ -25,7 +24,6 @@ BreakBeforeTernaryOperators: true BreakConstructorInitializers: AfterColon BreakStringLiterals: true ColumnLimit: 120 -ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 8 ContinuationIndentWidth: 8 Cpp11BracedListStyle: false @@ -39,6 +37,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false Language: Cpp MaxEmptyLinesToKeep: 2 NamespaceIndentation: Inner +PackConstructorInitializers: Never PointerAlignment: Left ReflowComments: false SortIncludes: false