11---
2+ # vim: ft=yaml
23Language : Cpp
34BasedOnStyle : Microsoft
45
56AccessModifierOffset : -4
67
7- AlignAfterOpenBracket : BlockIndent
8+ AlignAfterOpenBracket : true
89AlignArrayOfStructures : Left
910AlignConsecutiveAssignments :
1011 Enabled : true
@@ -20,7 +21,7 @@ AlignConsecutiveDeclarations:
2021 Enabled : true
2122 AcrossEmptyLines : false
2223 AcrossComments : true
23- # AlignFunctionDeclarations: false # only for AlignConsecutiveDeclarations # clang-format 20
24+ AlignFunctionDeclarations : true # only for AlignConsecutiveDeclarations # clang-format 20
2425 AlignFunctionPointers : false # only for AlignConsecutiveDeclarations
2526AlignConsecutiveMacros :
2627 Enabled : true
@@ -43,6 +44,7 @@ AllowAllConstructorInitializersOnNextLine: true
4344AllowAllParametersOfDeclarationOnNextLine : true
4445
4546AllowBreakBeforeNoexceptSpecifier : Never
47+ AllowBreakBeforeQtProperty : false # clang-format 22
4648
4749AllowShortBlocksOnASingleLine : Empty
4850AllowShortCaseExpressionOnASingleLine : true
@@ -53,6 +55,7 @@ AllowShortFunctionsOnASingleLine: InlineOnly
5355AllowShortIfStatementsOnASingleLine : Never
5456AllowShortLambdasOnASingleLine : Inline
5557AllowShortLoopsOnASingleLine : false
58+ AllowShortNamespacesOnASingleLine : false # clang-format 20
5659
5760AlwaysBreakAfterReturnType : None
5861AlwaysBreakBeforeMultilineStrings : true
@@ -64,8 +67,9 @@ AttributeMacros:
6467 - __ununsed
6568 - GSL_SUPPRESS
6669
67- BinPackArguments : false
68- BinPackParameters : false
70+ BinPackArguments : false
71+ BinPackLongBracedList : true # clang-format 21
72+ BinPackParameters : OnePerLine
6973
7074BitFieldColonSpacing : Both
7175BraceWrapping :
@@ -90,12 +94,24 @@ BraceWrapping:
9094BracedInitializerIndentWidth : 4
9195BreakAdjacentStringLiterals : true
9296BreakAfterAttributes : Leave
93- BreakAfterReturnType : ExceptShortType
97+ BreakAfterOpenBracketBracedList : true # clang-format 22
98+ BreakAfterOpenBracketFunction : true # clang-format 22
99+ BreakAfterOpenBracketIf : true # clang-format 22
100+ BreakAfterOpenBracketLoop : true # clang-format 22
101+ BreakAfterOpenBracketSwitch : true # clang-format 22
102+ BreakAfterReturnType : Automatic
94103BreakBeforeBinaryOperators : None # TBD
95104BreakBeforeBraces : Custom
105+ BreakBeforeCloseBracketBracedList : true # clang-format 22
106+ BreakBeforeCloseBracketFunction : true # clang-format 22
107+ BreakBeforeCloseBracketIf : true # clang-format 22
108+ BreakBeforeCloseBracketLoop : true # clang-format 22
109+ BreakBeforeCloseBracketSwitch : true # clang-format 22
96110BreakBeforeConceptDeclarations : Always
97111BreakBeforeInlineASMColon : Always
112+ BreakBeforeTemplateCloser : true # clang-format 21
98113BreakBeforeTernaryOperators : false
114+ BreakBinaryOperations : RespectPrecedence # clang-format 20
99115BreakConstructorInitializers : BeforeComma
100116BreakFunctionDefinitionParameters : false
101117BreakInheritanceList : BeforeComma
@@ -108,14 +124,15 @@ CompactNamespaces: false
108124ConstructorInitializerAllOnOneLineOrOnePerLine : true
109125ConstructorInitializerIndentWidth : 4
110126ContinuationIndentWidth : 4
111- Cpp11BracedListStyle : true
127+ Cpp11BracedListStyle : FunctionCall # clang-format 22
112128
113129DeriveLineEnding : true
114130DerivePointerAlignment : true
115131
116132DisableFormat : false
117133EmptyLineAfterAccessModifier : Leave
118134EmptyLineBeforeAccessModifier : Leave
135+ EnumTrailingComma : Leave # clang-format 21, not safe if not set to Leave
119136FixNamespaceComments : true
120137ForEachMacros :
121138 - foreach
@@ -139,6 +156,7 @@ IncludeIsMainSourceRegex: ""
139156IndentAccessModifiers : false
140157IndentCaseBlocks : false
141158IndentCaseLabels : false
159+ IndentExportBlock : false # clang-format 20
142160IndentExternBlock : NoIndent
143161IndentGotoLabels : false
144162IndentPPDirectives : BeforeHash
@@ -159,22 +177,33 @@ KeepEmptyLines:
159177 AtEndOfFile : true
160178 AtStartOfBlock : false
161179 AtStartOfFile : false
180+ KeepFormFeed : true # clang-format 20
162181
163182LambdaBodyIndentation : Signature
164183MacroBlockBegin : " " # TBD
165184MacroBlockEnd : " " # TBD
166185Macros : [] # TBD
167- # MainIncludeChar: Quota # clang-format 20
186+ # A vector of function-like macros whose invocations should be skipped by RemoveParentheses.
187+ MacrosSkippedByRemoveParentheses : [] # TBD, clang-format 21
188+ MainIncludeChar : Quote # clang-format 19
168189MaxEmptyLinesToKeep : 1
169190NamespaceIndentation : None
170191NamespaceMacros : [] # TBD A vector of macros which are used to open namespace blocks.
192+ NumericLiteralCase : # clang-format 22
193+ ExponentLetter : Leave
194+ HexDigit : Leave
195+ Prefix : Leave
196+ Suffix : Leave
197+
198+ OneLineFormatOffRegex : ' ' # clone-format 21
171199
172200PPIndentWidth : -1 # default to IndentWidth
173201PackConstructorInitializers : Never
174202
175203# Penalty is hard to understand, leave it to default(style=Microsoft)
176204# PenaltyBreakAssignment: 2
177205# PenaltyBreakBeforeFirstCallParameter: 19
206+ # PenaltyBreakBeforeMemberAccess: 150 # clang-format 20
178207# PenaltyBreakComment: 300
179208# PenaltyBreakFirstLessLess: 120
180209# PenaltyBreakOpenParenthesis: 0
@@ -195,6 +224,8 @@ ReferenceAlignment: Left
195224
196225ReflowComments : false
197226
227+ RemoveEmptyLinesInUnwrappedLines : true # clang-format 20
228+ RemoveParentheses : Leave # not safe if not Leave
198229RemoveSemicolon : false # not safe if true
199230
200231RequiresClausePosition : OwnLine
@@ -209,6 +240,7 @@ SortUsingDeclarations: false
209240
210241SpaceAfterCStyleCast : true
211242SpaceAfterLogicalNot : false
243+ SpaceAfterOperatorKeyword : false # clang-format 21
212244SpaceAfterTemplateKeyword : false
213245
214246SpaceAroundPointerQualifiers : Default
@@ -268,6 +300,8 @@ WhitespaceSensitiveMacros:
268300 - PP_STRINGIZE
269301 - BOOST_PP_STRINGIZE
270302
303+ WrapNamespaceBodyWithEmptyLines : Always # clang-format 20
304+
271305---
272306Language : Json
273307BreakArrays : false
0 commit comments