This repository was archived by the owner on Mar 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.clang-format
332 lines (312 loc) · 13.7 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
# ---
# BasedOnStyle: LLVM
# ---
# REQUIRE: clang-format 3.5
# C++ format configuration
Language: Cpp
# REQUIRE: clang-format 3.3
#! The extra indent or outdent of access modifiers, e.g. public:.
AccessModifierOffset: -4
#! If the function declaration doesn’t fit on a line, allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false.
AllowAllParametersOfDeclarationOnNextLine: true
#! Dependent on the value, if (a) return; can be put on a single line.
AllowShortIfStatementsOnASingleLine: WithoutElse
#! Indent case labels one level from the switch statement.
IndentCaseLabels: true
# REQUIRE: clang-format 3.4
#! If true, always break before multiline string literals.
AlwaysBreakBeforeMultilineStrings: false
#! The template declaration breaking style to use.
AlwaysBreakTemplateDeclarations: Yes
#! If true, format braced lists as best suited for C++11 braced lists.
Cpp11BracedListStyle: true
#! The SpacesInAnglesStyle to use for template argument lists.
SpacesInAngles: Never
# REQUIRE: clang-format 3.5
#! If true, horizontally align operands of binary and ternary expressions.
AlignOperands: AlignAfterOperator
#! Dependent on the value, while (true) { continue; } can be put on a single line.
AllowShortBlocksOnASingleLine: true
#! Dependent on the value, int f() { return 0; } can be put on a single line.
AllowShortFunctionsOnASingleLine: Empty
#! If true, a space is inserted after C style casts.
SpaceAfterCStyleCast: false
#! Defines in which cases to put a space before opening parentheses.
SpaceBeforeParens: Custom
# REQUIRE: clang-format 3.6
#! If true, short case labels will be contracted to a single line.
AllowShortCaseLabelsOnASingleLine: false
#! The way to wrap binary operators.
BreakBeforeBinaryOperators: NonAssignment
# REQUIRE: clang-format 3.7
#! Control of trailing comments.
# AlignTrailingComments:
# Kind: Always
# OverEmptyLines: 0
#! If true, while (true) continue; can be put on a single line.
AllowShortLoopsOnASingleLine: true
#! If false, a function call’s arguments will either be all on the same line or will have one line each.
BinPackArguments: false
#! If false, a function declaration’s or function definition’s parameters will either all be on the same line or will have one line each.
BinPackParameters: false
#! The brace breaking style to use.
BreakBeforeBraces: Attach
#! If true, ternary operators will be placed after line breaks.
BreakBeforeTernaryOperators: true
#! The column limit.
ColumnLimit: 80
#! A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed.
CommentPragmas: '^(!<)? IWYU pragma:'
#! The number of characters to use for indentation of constructor initializer lists as well as inheritance lists.
ConstructorInitializerIndentWidth: 4
#! Indent width for line continuations.
ContinuationIndentWidth: 4
#! If true, analyze the formatted file for the most common alignment of & and *. Pointer and reference alignment styles are going to be updated according to the preferences found in the file. PointerAlignment is then used only as fallback.
DerivePointerAlignment: true
#! Disables formatting completely.
DisableFormat: false
#! A vector of macros that should be interpreted as foreach loops instead of as function calls.
ForEachMacros: []
#! The number of columns to use for indentation.
IndentWidth: 4
#! Indent if a function definition or declaration is wrapped after the type.
IndentWrappedFunctionNames: true
#! If true, the empty line at the start of blocks is kept.
KeepEmptyLinesAtTheStartOfBlocks: false
#! A regular expression matching macros that start a block.
MacroBlockBegin: ''
#! A regular expression matching macros that end a block.
MacroBlockEnd: ''
#! The maximum number of consecutive empty lines to keep.
MaxEmptyLinesToKeep: 1
#! The indentation used for namespaces.
NamespaceIndentation: None
#! Pointer and reference alignment style.
PointerAlignment: Right
#! If false, spaces will be removed before assignment operators.
SpaceBeforeAssignmentOperators: true
#! If true, spaces may be inserted into ().
SpaceInEmptyParentheses: false
#! The number of spaces before trailing line comments (// - comments).
SpacesBeforeTrailingComments: 1
#! If true, spaces may be inserted into C style casts.
SpacesInCStyleCastParentheses: false
#! If true, spaces will be inserted after ( and before ).
SpacesInParentheses: false
#! If true, spaces will be inserted after [ and before ]. Lambdas without arguments or unspecified size array declarations will not be affected.
SpacesInSquareBrackets: false
#! Parse and format C++ constructs compatible with this standard.
Standard: Latest
#! The number of columns used for tab stops.
TabWidth: 4
#! The way to use tab characters in the resulting file.
UseTab: Never
# REQUIRE: clang-format 3.8
#! If true, horizontally aligns arguments after an open bracket.
AlignAfterOpenBracket: AlwaysBreak
#! Style of aligning consecutive assignments.
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: true
PadOperators: true
#! Style of aligning consecutive declarations.
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
#! The function declaration return type breaking style to use.
AlwaysBreakAfterReturnType: None
#! Penalty for putting the return type of a function onto its own line.
PenaltyReturnTypeOnItsOwnLine: 128
#! Control of individual brace wrapping cases.
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
#! If true, clang-format will attempt to re-flow comments. That is it will touch a comment and reflow long comments into new lines, trying to obey the ColumnLimit.
ReflowComments: true
#! Controls if and how clang-format will sort #includes.
SortIncludes: Never
# REQUIRE: clang-format 3.9
#! Allow breaking string literals when formatting.
BreakStringLiterals: true
# REQUIRE: clang-format 4
#! If true, a space will be inserted after the ‘template’ keyword.
SpaceAfterTemplateKeyword: true
# REQUIRE: clang-format 5
#! Options for aligning backslashes in escaped newlines.
AlignEscapedNewlines: Left
#! The break constructor initializers style to use.
BreakConstructorInitializers: BeforeComma
#! If true, consecutive namespace declarations will be on the same line. If false, each namespace is declared on a new line.
CompactNamespaces: false
#! If true, clang-format adds missing namespace end comments for namespaces and fixes invalid existing ones. This doesn’t affect short namespaces, which are controlled by ShortNamespaceLines.
FixNamespaceComments: true
#! Controls if and how clang-format will sort using declarations.
# SortUsingDeclarations: LexicographicNumeric
SortUsingDeclarations: true
# REQUIRE: clang-format 6
#! Dependent on the value, multiple #include blocks can be sorted as one and divided based on category.
IncludeBlocks: Regroup
#! The preprocessor directive indenting style to use.
IndentPPDirectives: None
# REQUIRE: clang-format 7
#! The inheritance list style to use.
BreakInheritanceList: BeforeComma
#! If true, a space will be inserted before a C++11 braced list used to initialize an object (after the preceding identifier or type).
SpaceBeforeCpp11BracedList: false
#! If false, spaces will be removed before constructor initializer colon.
SpaceBeforeCtorInitializerColon: true
#! If false, spaces will be removed before inheritance colon.
SpaceBeforeInheritanceColon: true
#! If false, spaces will be removed before range-based for loop colon.
SpaceBeforeRangeBasedForLoopColon: true
# REQUIRE: clang-format 8
#! A vector of macros that should be interpreted as complete statements.
StatementMacros:
- Q_UNUSED
# REQUIRE: clang-format 9
#! Style of aligning consecutive macro definitions.
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
#! If a function call or braced initializer list doesn’t fit on a line, allow putting all arguments onto the next line, even if BinPackArguments is false.
AllowAllArgumentsOnNextLine: true
#! Dependent on the value, auto lambda []() { return 0; } can be put on a single line.
AllowShortLambdasOnASingleLine: Empty
#! A vector of macros which are used to open namespace blocks.
NamespaceMacros: []
#! If true, a space is inserted after the logical not operator (!).
SpaceAfterLogicalNot: false
#! A vector of macros that should be interpreted as type declarations instead of as function calls.
TypenameMacros: []
# REQUIRE: clang-format 10
#! Indent goto labels.
IndentGotoLabels: false
#! If true, spaces will be before [. Lambdas will not be affected. Only the first [ will get a space added.
SpaceBeforeSquareBrackets: false
#! If true, spaces will be inserted into {}.
SpaceInEmptyBlock: false
#! If true, spaces will be inserted around if/for/switch/while conditions.
SpacesInConditionalStatement: false
# REQUIRE: clang-format 11
#! Style of aligning consecutive bit fields.
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
#! Allow short enums on a single line.
AllowShortEnumsOnASingleLine: false
#! Indent case label blocks one level from the case label.
IndentCaseBlocks: false
#! IndentExternBlockStyle is the type of indenting of extern blocks.
IndentExternBlock: NoIndent
# REQUIRE: clang-format 12
#! A vector of strings that should be interpreted as attributes/qualifiers instead of identifiers. This can be useful for language extensions or static analyzer annotations.
AttributeMacros:
- __capability
- __output
- __ununsed
#! The BitFieldColonSpacingStyle to use for bitfields.
BitFieldColonSpacing: Both
#! The concept declaration style to use.
BreakBeforeConceptDeclarations: Always
#! Defines in which cases to put empty line before access modifiers.
EmptyLineBeforeAccessModifier: Always
#! Defines in which cases to put a space before or after pointer qualifiers
SpaceAroundPointerQualifiers: Default
#! If false, spaces will be removed before case colon.
SpaceBeforeCaseColon: false
#! Macros which are ignored in front of a statement, as if they were an attribute. So that they are not parsed as identifier, for example for Qts emit.
StatementAttributeLikeMacros:
- emit
# REQUIRE: clang-format 13
#! if not None, when using initialization for an array of structs aligns the fields into columns.
AlignArrayOfStructures: Left
#! Defines when to put an empty line after access modifiers. EmptyLineBeforeAccessModifier configuration handles the number of empty lines between two access modifiers.
EmptyLineAfterAccessModifier: Never
#! A vector of macros that should be interpreted as conditionals instead of as function calls.
IfMacros: []
#! Specify whether access modifiers should have their own indentation level.
IndentAccessModifiers: false
#! The indentation style of lambda bodies. Signature (the default) causes the lambda body to be indented one additional level relative to the indentation level of the signature.
LambdaBodyIndentation: Signature
#! The number of columns to use for indentation of preprocessor statements. When set to -1 (default) IndentWidth is used also for preprocessor statements.
PPIndentWidth: 1
#! Reference alignment style (overrides PointerAlignment for references).
ReferenceAlignment: Right
#! The maximal number of unwrapped lines that a short namespace spans. Defaults to 1.
ShortNamespaceLines: 0
#! How many spaces are allowed at the start of a line comment.
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
# REQUIRE: clang-format 14
#! The pack constructor initializers style to use.
PackConstructorInitializers: Never
#! Different ways to arrange specifiers and qualifiers (e.g. const/volatile).
QualifierAlignment: Leave
#! The order in which the qualifiers appear.
# QualifierOrder:
# - friend
# - static
# - inline
# - constexpr
# - const
# - volatile
# - type
# - restrict
#! Specifies the use of empty lines to separate definition blocks, including classes, structs, enums, and functions.
SeparateDefinitionBlocks: Always
#! Control of individual space before parentheses.
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
# REQUIRE: clang-format 15
#! Indent the requires clause in a template. This only applies when RequiresClausePosition is OwnLine, or WithFollowing.
IndentRequiresClause: true
#! Insert braces after control statements (if, else, for, do, and while) in C++ unless the control statements are inside macro definitions or the braces would enclose preprocessor directives.
InsertBraces: false
#! The position of the requires clause.
RequiresClausePosition: OwnLine
# REQUIRE: clang-format 16
#! Break after a group of C++11 attributes before a function declaration/definition name.
# BreakAfterAttributes: Never
#! The inline ASM colon style to use.
# BreakBeforeInlineASMColon: Always
#! Insert a newline at end of file if missing.
# InsertNewlineAtEOF: true
#! Format integer literal separators (' for C++ and _ for C#, Java, and JavaScript).
# IntegerLiteralSeparator:
# Binary: 4
# Decimal: 3
# Hex: 2
#! Line ending style (\n or \r\n) to use.
# LineEnding: CRLF
#! The indentation used for requires expression bodies.
# RequiresExpressionIndentation: OuterScope
...