-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
674 lines (514 loc) · 23 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
###############################################################################
# @Project : app
# @File : .clang-format
# @Description : Clang-Format configuration file, fully detailed with comments,
# based on the provided configuration dump, including all
# formatting options for C++, and placeholder sections for other
# languages. This enforces consistent coding style and formatting
# across the project.
#
# @Author : Alan Szmyt
# @Date : 2024-09-22
# @Version : 1.0
###############################################################################
# Base style to inherit from.
BasedOnStyle: Google
# General configuration options applicable to all languages.
---
Language: Cpp # Applies to C, C++, and Objective-C.
# AccessModifierOffset: Indentation level for access modifiers (public, protected, private).
# Negative value will unindent, positive will indent.
AccessModifierOffset: -1
# AlignAfterOpenBracket: Controls alignment of parameters after an open bracket.
# Options: Align, DontAlign, AlwaysBreak
AlignAfterOpenBracket: Align
# AlignArrayOfStructures: Alignment style for arrays of structures.
# Options: None, Left, Right
AlignArrayOfStructures: None
# AlignConsecutiveAssignments: Configuration for aligning consecutive assignments.
AlignConsecutiveAssignments:
Enabled: false # Whether to enable alignment.
AcrossEmptyLines: false # Whether to align across empty lines.
AcrossComments: false # Whether to align across comments.
AlignCompound: false # Whether to align compound assignments (+=, -=, etc.).
AlignFunctionPointers: false # Whether to align function pointer assignments.
PadOperators: true # Whether to pad operators with spaces.
# AlignConsecutiveBitFields: Configuration for aligning consecutive bit fields.
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
# AlignConsecutiveDeclarations: Configuration for aligning consecutive declarations.
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
# AlignConsecutiveMacros: Configuration for aligning consecutive macros.
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
# AlignConsecutiveShortCaseStatements: Configuration for aligning short case statements.
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseArrows: false # Whether to align arrows in case statements.
AlignCaseColons: false # Whether to align colons in case statements.
# AlignEscapedNewlines: Alignment of escaped newlines in line continuations.
# Options: Left, Right
AlignEscapedNewlines: Left
# AlignOperands: Controls alignment of operands in expressions.
# Options: Align, Don'tAlign
AlignOperands: Align
# AlignTrailingComments: Configuration for aligning trailing comments.
AlignTrailingComments:
Kind: Always # Options: Always, Never
OverEmptyLines: 0 # Maximum number of empty lines to align over.
# AllowAllArgumentsOnNextLine: Allows all arguments of a function call to be on the next line.
AllowAllArgumentsOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: Allows all parameters of a function declaration to be on the next line.
AllowAllParametersOfDeclarationOnNextLine: true
# AllowBreakBeforeNoexceptSpecifier: Allows line break before noexcept specifier.
# Options: All, NonEmpty, Never
AllowBreakBeforeNoexceptSpecifier: Never
# AllowShortBlocksOnASingleLine: Controls whether short blocks (if, else, etc.) can be on a single line.
# Options: Never, Empty, Always
AllowShortBlocksOnASingleLine: Never
# AllowShortCaseExpressionOnASingleLine: Allows short case expressions to be on a single line.
AllowShortCaseExpressionOnASingleLine: true
# AllowShortCaseLabelsOnASingleLine: Allows short case labels to be on a single line.
AllowShortCaseLabelsOnASingleLine: false
# AllowShortCompoundRequirementOnASingleLine: Allows short compound requirements to be on a single line.
AllowShortCompoundRequirementOnASingleLine: true
# AllowShortEnumsOnASingleLine: Allows short enums to be on a single line.
AllowShortEnumsOnASingleLine: true
# AllowShortFunctionsOnASingleLine: Allows short functions to be on a single line.
# Options: None, InlineOnly, Empty, Inline, All
AllowShortFunctionsOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Allows short if statements without else to be on a single line.
# Options: Never, WithoutElse, OnlyFirstIf
AllowShortIfStatementsOnASingleLine: WithoutElse
# AllowShortLambdasOnASingleLine: Allows short lambda expressions to be on a single line.
# Options: None, Empty, Inline, All
AllowShortLambdasOnASingleLine: All
# AllowShortLoopsOnASingleLine: Allows short loops to be on a single line.
AllowShortLoopsOnASingleLine: true
# AlwaysBreakAfterDefinitionReturnType: Controls breaking after function definition return type.
# Options: None, All, TopLevel, AllDefinitions, TopLevelDefinitions
AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakBeforeMultilineStrings: If true, always break before multiline strings.
AlwaysBreakBeforeMultilineStrings: true
# AttributeMacros: List of macros that behave like attributes.
AttributeMacros:
- __capability
# BinPackArguments: If true, function call arguments will be packed into as few lines as possible.
BinPackArguments: true
# BinPackParameters: If true, function declaration parameters will be packed into as few lines as possible.
BinPackParameters: true
# BitFieldColonSpacing: Controls spacing around bitfield colons.
# Options: Both, None, Before, After
BitFieldColonSpacing: Both
# BraceWrapping: Configuration for brace wrapping.
BraceWrapping:
AfterCaseLabel: false # Whether to add a line break after a case label.
AfterClass: false # Whether to add a line break after a class definition opening brace.
AfterControlStatement: Never # Options: Never, MultiLine, Always
AfterEnum: false # Whether to add a line break after an enum definition opening brace.
AfterExternBlock: false # Whether to add a line break after an extern block opening brace.
AfterFunction: false # Whether to add a line break after a function definition opening brace.
AfterNamespace: false # Whether to add a line break after a namespace opening brace.
AfterObjCDeclaration: false # Whether to add a line break after an Objective-C declaration.
AfterStruct: false # Whether to add a line break after a struct definition opening brace.
AfterUnion: false # Whether to add a line break after a union definition opening brace.
BeforeCatch: false # Whether to add a line break before a 'catch'.
BeforeElse: false # Whether to add a line break before an 'else'.
BeforeLambdaBody: false # Whether to add a line break before a lambda body.
BeforeWhile: false # Whether to add a line break before a 'while' in do-while loops.
IndentBraces: false # Whether to indent the braces themselves.
SplitEmptyFunction: true # Whether to split empty function braces.
SplitEmptyRecord: true # Whether to split empty record braces.
SplitEmptyNamespace: true # Whether to split empty namespace braces.
# BreakAdjacentStringLiterals: If true, will break apart adjacent string literals.
BreakAdjacentStringLiterals: true
# BreakAfterAttributes: Controls breaking after attributes.
# Options: None, Always, Leave
BreakAfterAttributes: Leave
# BreakAfterJavaFieldAnnotations: If true, break after Java field annotations.
BreakAfterJavaFieldAnnotations: false
# BreakAfterReturnType: Controls breaking after function declaration return type.
# Options: None, All, TopLevel, AllDefinitions, TopLevelDefinitions
BreakAfterReturnType: None
# BreakArrays: If true, will insert line breaks inside arrays.
BreakArrays: true
# BreakBeforeBinaryOperators: Controls the position of binary operators.
# Options: None, NonAssignment, All
BreakBeforeBinaryOperators: None
# BreakBeforeConceptDeclarations: Controls breaking before concept declarations.
# Options: Always, Never
BreakBeforeConceptDeclarations: Always
# BreakBeforeBraces: The brace breaking style to use.
# Options: Attach, Linux, Mozilla, Stroustrup, Allman, GNU, WebKit, Custom
BreakBeforeBraces: Attach
# BreakBeforeInlineASMColon: Controls breaking before inline assembly colons.
# Options: Never, Always, OnlyMultiline
BreakBeforeInlineASMColon: OnlyMultiline
# BreakBeforeTernaryOperators: Controls the position of ternary operators.
BreakBeforeTernaryOperators: true
# BreakConstructorInitializers: Controls the breaking of constructor initializers.
# Options: BeforeColon, BeforeComma, AfterColon
BreakConstructorInitializers: BeforeColon
# BreakFunctionDefinitionParameters: If true, break function definition parameters into separate lines.
BreakFunctionDefinitionParameters: false
# BreakInheritanceList: Controls the breaking of inheritance lists.
# Options: BeforeColon, BeforeComma, AfterColon
BreakInheritanceList: BeforeColon
# BreakStringLiterals: If true, will break long string literals.
BreakStringLiterals: true
# BreakTemplateDeclarations: Controls breaking of template declarations.
# Options: Yes, No, MultiLine
BreakTemplateDeclarations: Yes
# ColumnLimit: The column limit for wrapping lines.
ColumnLimit: 80
# CommentPragmas: Regular expression denoting comments with special meaning.
CommentPragmas: "^ IWYU pragma:"
# CompactNamespaces: If true, consecutive namespaces will be compacted.
CompactNamespaces: false
# ConstructorInitializerIndentWidth: Indentation width for constructor initializers.
ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: Indentation width for line continuations.
ContinuationIndentWidth: 4
# Cpp11BracedListStyle: If true, use C++11 braced list formatting.
Cpp11BracedListStyle: true
# DerivePointerAlignment: If true, pointer alignment is derived from the existing code.
DerivePointerAlignment: true
# DisableFormat: If true, disables formatting.
DisableFormat: false
# EmptyLineAfterAccessModifier: Controls empty lines after access modifiers.
# Options: Never, Leave, Always
EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: Controls empty lines before access modifiers.
# Options: Never, Leave, LogicalBlock, Always
EmptyLineBeforeAccessModifier: LogicalBlock
# ExperimentalAutoDetectBinPacking: If true, automatically detects bin-packing of function parameters.
ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: If true, adds comments to closing braces of namespaces.
FixNamespaceComments: true
# ForEachMacros: List of macros that should be interpreted as foreach loops.
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
# IfMacros: List of macros that should be interpreted as if statements.
IfMacros:
- KJ_IF_MAYBE
# IncludeBlocks: Controls how include blocks are handled.
# Options: Preserve, Merge, Regroup
IncludeBlocks: Regroup
# IncludeCategories: Priorities for sorting include statements.
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: "^<.*"
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: ".*"
Priority: 3
SortPriority: 0
CaseSensitive: false
# IncludeIsMainRegex: Regex matching the main include file of a source file.
IncludeIsMainRegex: "([-_](test|unittest))?$"
# IncludeIsMainSourceRegex: Regex matching source files.
IncludeIsMainSourceRegex: ""
# IndentAccessModifiers: If true, indents access modifiers (public, protected, private).
IndentAccessModifiers: false
# IndentCaseBlocks: If true, indents the contents of case blocks.
IndentCaseBlocks: false
# IndentCaseLabels: If true, indents case labels one level from the switch statement.
IndentCaseLabels: true
# IndentExternBlock: Controls indentation of extern blocks.
# Options: AfterExternBlock, NoIndent, Indent
IndentExternBlock: AfterExternBlock
# IndentGotoLabels: If true, indents goto labels.
IndentGotoLabels: true
# IndentPPDirectives: Controls indentation of preprocessor directives.
# Options: None, AfterHash, BeforeHash
IndentPPDirectives: None
# IndentRequiresClause: If true, indents requires clauses.
IndentRequiresClause: true
# IndentWidth: The number of columns to use for indentation.
IndentWidth: 2
# IndentWrappedFunctionNames: If true, indents when a function name is wrapped.
IndentWrappedFunctionNames: false
# InsertBraces: Controls whether to insert braces around control statements.
InsertBraces: false
# InsertNewlineAtEOF: If true, inserts a newline at the end of file if missing.
InsertNewlineAtEOF: false
# InsertTrailingCommas: Controls insertion of trailing commas in container literals.
# Options: None, Wrapped, All
InsertTrailingCommas: None
# IntegerLiteralSeparator: Configuration for digit grouping in integer literals.
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
# JavaScriptQuotes: Controls the use of quotes in JavaScript.
# Options: Leave, Single, Double
JavaScriptQuotes: Leave
# JavaScriptWrapImports: If true, wraps long import statements in JavaScript.
JavaScriptWrapImports: true
# KeepEmptyLines: Controls keeping of empty lines.
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: false
AtStartOfFile: true
# LambdaBodyIndentation: Controls indentation of lambda bodies.
# Options: Signature, OuterScope
LambdaBodyIndentation: Signature
# LineEnding: Controls the line ending style.
# Options: LF, CRLF, DeriveLF, DeriveCRLF
LineEnding: DeriveLF
# MacroBlockBegin: Regex matching the beginning of a macro block.
MacroBlockBegin: ""
# MacroBlockEnd: Regex matching the end of a macro block.
MacroBlockEnd: ""
# MainIncludeChar: Character used for main include.
# Options: '<', '"'
MainIncludeChar: Quote
# MaxEmptyLinesToKeep: Maximum number of consecutive empty lines to keep.
MaxEmptyLinesToKeep: 1
# NamespaceIndentation: Controls indentation of namespace contents.
# Options: None, Inner, All
NamespaceIndentation: None
# ObjCBinPackProtocolList: Controls bin-packing of Objective-C protocol lists.
# Options: Auto, Never, Always
ObjCBinPackProtocolList: Never
# ObjCBlockIndentWidth: Indentation width for Objective-C blocks.
ObjCBlockIndentWidth: 2
# ObjCBreakBeforeNestedBlockParam: If true, breaks before nested block parameters in Objective-C.
ObjCBreakBeforeNestedBlockParam: true
# ObjCSpaceAfterProperty: If true, adds space after @property in Objective-C.
ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: If true, adds space before protocol list in Objective-C.
ObjCSpaceBeforeProtocolList: true
# PackConstructorInitializers: Controls packing of constructor initializers.
# Options: Never, Always, BinPack, NextLine
PackConstructorInitializers: NextLine
# PenaltyBreakAssignment: Penalty for breaking assignments.
PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: Penalty for breaking before the first function call parameter.
PenaltyBreakBeforeFirstCallParameter: 1
# PenaltyBreakComment: Penalty for breaking a comment.
PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: Penalty for breaking << at the start of a line.
PenaltyBreakFirstLessLess: 120
# PenaltyBreakOpenParenthesis: Penalty for breaking after an open parenthesis.
PenaltyBreakOpenParenthesis: 0
# PenaltyBreakScopeResolution: Penalty for breaking scope resolution.
PenaltyBreakScopeResolution: 500
# PenaltyBreakString: Penalty for each line break introduced inside a string literal.
PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: Penalty for breaking a template declaration.
PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: Penalty for each character outside of the column limit.
PenaltyExcessCharacter: 1000000
# PenaltyIndentedWhitespace: Penalty for each level of indentation.
PenaltyIndentedWhitespace: 0
# PenaltyReturnTypeOnItsOwnLine: Penalty for putting the return type on its own line.
PenaltyReturnTypeOnItsOwnLine: 200
# PointerAlignment: Controls alignment of pointer and reference operators.
# Options: Left, Right, Middle
PointerAlignment: Left
# PPIndentWidth: Indentation width for preprocessor directives.
PPIndentWidth: -1
# QualifierAlignment: Controls alignment of qualifiers.
# Options: Leave, Left, Right
QualifierAlignment: Leave
# RawStringFormats: Configuration for formatting raw strings.
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- "c++"
- "C++"
CanonicalDelimiter: ""
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
# ReferenceAlignment: Controls alignment of reference operators.
# Options: Pointer, Left, Right, Middle
ReferenceAlignment: Pointer
# ReflowComments: If true, enables reflowing and reformatting of comments.
ReflowComments: true
# RemoveBracesLLVM: If true, removes redundant braces as per LLVM style.
RemoveBracesLLVM: false
# RemoveParentheses: Controls removal of redundant parentheses.
# Options: Leave, Always
RemoveParentheses: Leave
# RemoveSemicolon: If true, removes unnecessary semicolons.
RemoveSemicolon: false
# RequiresClausePosition: Controls position of requires clauses.
# Options: OwnLine, WithPreceding
RequiresClausePosition: OwnLine
# RequiresExpressionIndentation: Controls indentation of requires expressions.
# Options: OuterScope, InnerScope
RequiresExpressionIndentation: OuterScope
# SeparateDefinitionBlocks: Controls separation of definition blocks.
# Options: Leave, Always
SeparateDefinitionBlocks: Leave
# ShortNamespaceLines: Lines considered short for namespace definitions.
ShortNamespaceLines: 1
# SkipMacroDefinitionBody: If true, skips formatting of macro definitions.
SkipMacroDefinitionBody: false
# SortIncludes: Controls sorting of include directives.
# Options: Never, CaseSensitive, CaseInsensitive
SortIncludes: CaseSensitive
# SortJavaStaticImport: Controls sorting of static imports in Java.
# Options: Before, After
SortJavaStaticImport: Before
# SortUsingDeclarations: Controls sorting of using declarations.
# Options: Never, Lexicographic, LexicographicNumeric
SortUsingDeclarations: LexicographicNumeric
# SpaceAfterCStyleCast: If true, adds space after C-style casts.
SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: If true, adds space after logical not operator.
SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: If true, adds space after 'template' keyword.
SpaceAfterTemplateKeyword: true
# SpaceAroundPointerQualifiers: Controls spacing around pointer qualifiers.
# Options: Default, Before, After, Both
SpaceAroundPointerQualifiers: Default
# SpaceBeforeAssignmentOperators: If true, adds space before assignment operators.
SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: If true, adds space before colon in case labels.
SpaceBeforeCaseColon: false
# SpaceBeforeCpp11BracedList: If true, adds space before C++11 braced lists.
SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: If true, adds space before constructor initializer colon.
SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: If true, adds space before inheritance colon.
SpaceBeforeInheritanceColon: true
# SpaceBeforeJsonColon: If true, adds space before colon in JSON.
SpaceBeforeJsonColon: false
# SpaceBeforeParens: Controls spaces before parentheses.
# Options: Never, ControlStatements, Always
SpaceBeforeParens: ControlStatements
# SpaceBeforeParensOptions: Detailed control over spaces before parentheses.
SpaceBeforeParensOptions:
AfterControlStatements: true # if, for, while, switch, etc.
AfterForeachMacros: true # Macros that behave like foreach loops.
AfterFunctionDefinitionName: false # Function definition names.
AfterFunctionDeclarationName: false # Function declaration names.
AfterIfMacros: true # Macros that behave like if statements.
AfterOverloadedOperator: false # Overloaded operators.
AfterPlacementOperator: true # Placement new/delete.
AfterRequiresInClause: false # Requires clauses.
AfterRequiresInExpression: false # Requires expressions.
BeforeNonEmptyParentheses: false # Non-empty parentheses.
# SpaceBeforeRangeBasedForLoopColon: If true, adds space before colon in range-based for loops.
SpaceBeforeRangeBasedForLoopColon: true
# SpaceBeforeSquareBrackets: If true, adds space before square brackets.
SpaceBeforeSquareBrackets: false
# SpaceInEmptyBlock: If true, adds space in empty blocks.
SpaceInEmptyBlock: false
# SpacesBeforeTrailingComments: Minimum number of spaces before trailing comments.
SpacesBeforeTrailingComments: 2
# SpacesInAngles: Controls spaces inside angle brackets.
# Options: Never, Always, Around
SpacesInAngles: Never
# SpacesInContainerLiterals: If true, adds spaces inside container literals.
SpacesInContainerLiterals: true
# SpacesInLineCommentPrefix: Controls spaces in line comment prefixes.
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
# SpacesInParens: Controls spaces inside parentheses.
# Options: Never, Always
SpacesInParens: Never
# SpacesInParensOptions: Detailed control over spaces in parentheses.
SpacesInParensOptions:
ExceptDoubleParentheses: false # Exclude nested parentheses.
InCStyleCasts: false # In C-style casts.
InConditionalStatements: false # In if, for, while conditions.
InEmptyParentheses: false # In empty parentheses.
Other: false # In other contexts.
# SpacesInSquareBrackets: Controls spaces inside square brackets.
SpacesInSquareBrackets: false
# Standard: The language standard to format for.
# Options: Auto, C++98, C++11, C++14, C++17, C++20, Latest
Standard: Auto
# StatementAttributeLikeMacros: List of macros that behave like attributes on statements.
StatementAttributeLikeMacros:
- Q_EMIT
# StatementMacros: List of macros that should be interpreted as statements.
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
# TabWidth: Number of spaces per tab character.
TabWidth: 8
# UseTab: Controls the use of tab characters.
# Options: Never, ForIndentation, ForContinuationAndIndentation, Always
UseTab: Never
# WhitespaceSensitiveMacros: List of macros that are sensitive to whitespace changes.
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...
# Placeholder sections for other languages.
---
Language: JavaScript # Applies to JavaScript and TypeScript.
# [Add JavaScript-specific formatting options here.]
---
Language: Java
# [Add Java-specific formatting options here.]
---
Language: Proto # Applies to Protocol Buffers.
# [Add Proto-specific formatting options here.]
---
Language: CSharp # Applies to C#.
# [Add C#-specific formatting options here.]
---
# Additional language configurations can be added following the same pattern.
# For Objective-C, CUDA, and other languages, specify the Language and options accordingly.