Skip to content

Commit 2c177eb

Browse files
author
MarkusB
committed
chore: update .clang-format configuration to v22
1 parent aaf4b10 commit 2c177eb

1 file changed

Lines changed: 141 additions & 2 deletions

File tree

.clang-format

Lines changed: 141 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,48 @@ Language: Cpp
33
BasedOnStyle: LLVM
44
AccessModifierOffset: -4
55
AlignAfterOpenBracket: AlwaysBreak
6+
AlignArrayOfStructures: None
67
AlignConsecutiveMacros: true
78
AlignConsecutiveAssignments: false
89
AlignConsecutiveDeclarations: false
10+
AlignConsecutiveBitFields:
11+
Enabled: false
12+
AcrossEmptyLines: false
13+
AcrossComments: false
14+
AlignCompound: false
15+
AlignFunctionDeclarations: false
16+
AlignFunctionPointers: false
17+
PadOperators: false
18+
AlignConsecutiveShortCaseStatements:
19+
Enabled: false
20+
AcrossEmptyLines: false
21+
AcrossComments: false
22+
AlignCaseArrows: false
23+
AlignCaseColons: false
24+
AlignConsecutiveTableGenBreakingDAGArgColons:
25+
Enabled: false
26+
AcrossEmptyLines: false
27+
AcrossComments: false
28+
AlignCompound: false
29+
AlignFunctionDeclarations: false
30+
AlignFunctionPointers: false
31+
PadOperators: false
32+
AlignConsecutiveTableGenCondOperatorColons:
33+
Enabled: false
34+
AcrossEmptyLines: false
35+
AcrossComments: false
36+
AlignCompound: false
37+
AlignFunctionDeclarations: false
38+
AlignFunctionPointers: false
39+
PadOperators: false
40+
AlignConsecutiveTableGenDefinitionColons:
41+
Enabled: false
42+
AcrossEmptyLines: false
43+
AcrossComments: false
44+
AlignCompound: false
45+
AlignFunctionDeclarations: false
46+
AlignFunctionPointers: false
47+
PadOperators: false
948
AlignEscapedNewlines: DontAlign
1049
AlignOperands: true
1150
AlignTrailingComments: false
@@ -19,15 +58,22 @@ AllowShortFunctionsOnASingleLine: None
1958
AllowShortIfStatementsOnASingleLine: Never
2059
AllowShortLambdasOnASingleLine: None
2160
AllowShortLoopsOnASingleLine: false
61+
AllowShortNamespacesOnASingleLine: true
62+
AllowBreakBeforeNoexceptSpecifier: Never
63+
AllowBreakBeforeQtProperty: false
64+
AllowShortCaseExpressionOnASingleLine: true
65+
AllowShortCompoundRequirementOnASingleLine: true
2266
AlwaysBreakAfterDefinitionReturnType: None
2367
AlwaysBreakAfterReturnType: None
2468
AlwaysBreakBeforeMultilineStrings: false
2569
AlwaysBreakTemplateDeclarations: Yes
2670
#AttributeMacros:
2771
# - ...
2872
BinPackArguments: true
73+
BinPackLongBracedList: true
2974
BinPackParameters: true
3075
BitFieldColonSpacing: Both
76+
BracedInitializerIndentWidth: -1
3177
BraceWrapping:
3278
AfterCaseLabel: false
3379
AfterClass: false
@@ -39,6 +85,7 @@ BraceWrapping:
3985
AfterUnion: false
4086
# necessary exception because of a bug indenting the content otherwise (v9 at least)
4187
AfterExternBlock: false
88+
AfterObjCDeclaration: false
4289
BeforeCatch: false
4390
BeforeElse: false
4491
BeforeLambdaBody: false
@@ -51,11 +98,28 @@ BreakBeforeBinaryOperators: NonAssignment
5198
BreakBeforeBraces: Attach
5299
BreakBeforeConceptDeclarations: true
53100
BreakBeforeInheritanceComma: false
54-
#BreakBeforeInlineASMColon: Always
101+
BreakBeforeInlineASMColon: OnlyMultiline
55102
BreakInheritanceList: BeforeComma
56103
BreakBeforeTernaryOperators: true
57104
BreakConstructorInitializers: BeforeComma
58105
BreakStringLiterals: true
106+
BreakAdjacentStringLiterals: true
107+
BreakAfterAttributes: Leave
108+
BreakAfterJavaFieldAnnotations: false
109+
BreakAfterOpenBracketBracedList: true
110+
BreakAfterOpenBracketFunction: true
111+
BreakAfterOpenBracketIf: true
112+
BreakAfterOpenBracketLoop: true
113+
BreakAfterOpenBracketSwitch: true
114+
BreakArrays: true
115+
BreakBeforeCloseBracketBracedList: true
116+
BreakBeforeCloseBracketFunction: false
117+
BreakBeforeCloseBracketIf: false
118+
BreakBeforeCloseBracketLoop: false
119+
BreakBeforeCloseBracketSwitch: false
120+
BreakBeforeTemplateCloser: false
121+
BreakBinaryOperations: Never
122+
BreakFunctionDefinitionParameters: false
59123
ColumnLimit: 120
60124
CommentPragmas: '^([^ ]| IWYU pragma:)'
61125
CompactNamespaces: false
@@ -67,9 +131,12 @@ DeriveLineEnding: true
67131
DerivePointerAlignment: false
68132
DisableFormat: false
69133
EmptyLineBeforeAccessModifier: Always
134+
EmptyLineAfterAccessModifier: Never
135+
EnumTrailingComma: Insert
70136
ExperimentalAutoDetectBinPacking: false
71137
FixNamespaceComments: true
72138
ForEachMacros: [foreach, FOREACH, Q_FOREACH, BOOST_FOREACH]
139+
IfMacros: []
73140
IncludeBlocks: Preserve
74141
IncludeCategories:
75142
- Regex: '^<.*>'
@@ -84,46 +151,73 @@ IncludeCategories:
84151
Priority: 1
85152
IncludeIsMainRegex: ''
86153
IncludeIsMainSourceRegex: '(\.test\.)?'
154+
IndentAccessModifiers: false
155+
IndentCaseBlocks: false
87156
IndentCaseLabels: true
157+
IndentExportBlock: true
88158
IndentExternBlock: NoIndent
89159
IndentGotoLabels: false
90160
IndentPPDirectives: None
91161
IndentRequiresClause: true
92162
IndentWidth: 4
93163
IndentWrappedFunctionNames: false
94164
KeepEmptyLinesAtTheStartOfBlocks: false
165+
KeepFormFeed: false
95166
LambdaBodyIndentation: Signature
167+
LineEnding: DeriveLF
96168
MacroBlockBegin: '#if'
97169
MacroBlockEnd: '#endif|#else|#elif'
170+
MainIncludeChar: Quote
98171
MaxEmptyLinesToKeep: 2
99172
NamespaceIndentation: None
100173
#NamespaceMacros:
101174
# - ...
175+
NumericLiteralCase:
176+
ExponentLetter: Leave
177+
HexDigit: Leave
178+
Prefix: Leave
179+
Suffix: Upper
180+
ObjCBinPackProtocolList: Auto
181+
ObjCBlockIndentWidth: 2
182+
ObjCBreakBeforeNestedBlockParam: true
183+
ObjCSpaceAfterProperty: false
184+
ObjCSpaceBeforeProtocolList: true
185+
OneLineFormatOffRegex: ''
102186
PackConstructorInitializers: Never
103187
PenaltyBreakAssignment: 2
104188
PenaltyBreakBeforeFirstCallParameter: 1
189+
PenaltyBreakBeforeMemberAccess: 150
105190
PenaltyBreakComment: 300
106191
PenaltyBreakFirstLessLess: 120
107192
PenaltyBreakOpenParenthesis: 1
193+
PenaltyBreakScopeResolution: 500
108194
PenaltyBreakString: 1000
109195
PenaltyBreakTemplateDeclaration: 10
110196
PenaltyExcessCharacter: 1000000
111197
PenaltyIndentedWhitespace: 1
112198
PenaltyReturnTypeOnItsOwnLine: 200
113199
PointerAlignment: Left
200+
PPIndentWidth: -1
114201
QualifierAlignment: Custom
115202
# 'export' has to be first always anyway, so no need to be supported (it isn't)
116203
# 'friend' not yet supported, will go first
117204
QualifierOrder: ['static', 'inline', 'constexpr', 'const', 'volatile', 'restrict', 'type']
118205
ReferenceAlignment: Left
119206
ReflowComments: true
120-
#RemoveSemicolon: true
207+
RemoveBracesLLVM: false
208+
RemoveEmptyLinesInUnwrappedLines: true
209+
RemoveParentheses: ReturnStatement
210+
RemoveSemicolon: true
121211
RequiresClausePosition: OwnLine
212+
RequiresExpressionIndentation: OuterScope
122213
SeparateDefinitionBlocks: Always
123214
ShortNamespaceLines: 0
124215
SortIncludes: CaseInsensitive
125216
SortUsingDeclarations: true
217+
SkipMacroDefinitionBody: false
218+
SortJavaStaticImport: Before
126219
SpaceAfterCStyleCast: false
220+
SpaceAfterOperatorKeyword: false
127221
SpaceAfterLogicalNot: false
128222
SpaceAfterTemplateKeyword: true
129223
SpaceAroundPointerQualifiers: Default
@@ -133,8 +227,22 @@ SpaceBeforeCpp11BracedList: false
133227
SpaceBeforeCtorInitializerColon: true
134228
SpaceBeforeInheritanceColon: true
135229
SpaceBeforeParens: ControlStatements
230+
SpaceBeforeParensOptions:
231+
AfterControlStatements: true
232+
AfterForeachMacros: true
233+
AfterFunctionDefinitionName: false
234+
AfterFunctionDeclarationName: false
235+
AfterIfMacros: true
236+
AfterNot: false
237+
AfterOverloadedOperator: false
238+
AfterPlacementOperator: true
239+
AfterRequiresInClause: false
240+
AfterRequiresInExpression: false
241+
BeforeNonEmptyParentheses: false
136242
SpaceBeforeRangeBasedForLoopColon: true
243+
SpaceBeforeJsonColon: false
137244
SpaceInEmptyBlock: false
245+
SpaceInEmptyBraces: Never
138246
SpaceInEmptyParentheses: false
139247
SpacesBeforeTrailingComments: 1
140248
SpacesInAngles: false
@@ -145,8 +253,15 @@ SpacesInLineCommentPrefix:
145253
Maximum: -1
146254
Minimum: 1
147255
SpacesInParentheses: false
256+
SpacesInParensOptions:
257+
ExceptDoubleParentheses: false
258+
InCStyleCasts: false
259+
InConditionalStatements: false
260+
InEmptyParentheses: false
261+
Other: false
148262
SpacesInSquareBrackets: false
149263
SpaceBeforeSquareBrackets: false
264+
TableGenBreakInsideDAGArg: DontBreak
150265
Standard: Latest
151266
StatementAttributeLikeMacros: [emit]
152267
StatementMacros:
@@ -157,10 +272,34 @@ TabWidth: 4
157272
# - ...
158273
UseCRLF: false
159274
UseTab: Never
275+
VerilogBreakBetweenInstancePorts: true
160276
WhitespaceSensitiveMacros:
161277
- UL_STRINGIFY
162278
- UL_WARNING_DISABLE_CLANG
163279
- UL_WARNING_DISABLE_GCC
164280
- UL_WARNING_DISABLE_MSVC
281+
InsertBraces: false
282+
InsertNewlineAtEOF: true
283+
InsertTrailingCommas: Wrapped
284+
IntegerLiteralSeparator:
285+
Binary: 4
286+
BinaryMinDigitsInsert: 0
287+
BinaryMaxDigitsRemove: 0
288+
Decimal: 3
289+
DecimalMinDigitsInsert: 0
290+
DecimalMaxDigitsRemove: 0
291+
Hex: 4
292+
HexMinDigitsInsert: 0
293+
HexMaxDigitsRemove: 0
294+
BinaryMinDigits: 0
295+
DecimalMinDigits: 0
296+
HexMinDigits: 0
297+
JavaScriptQuotes: Leave
298+
JavaScriptWrapImports: true
299+
KeepEmptyLines:
300+
AtEndOfFile: false
301+
AtStartOfBlock: false
302+
AtStartOfFile: true
303+
WrapNamespaceBodyWithEmptyLines: Never
165304

166305
...

0 commit comments

Comments
 (0)