Debian Codegraph @

.clang-format

raw
1 # Copyright (c) 2016, 2026, Oracle and/or its affiliates.
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License, version 2.0,
5 # as published by the Free Software Foundation.
6 #
7 # This program is designed to work with certain software (including
8 # but not limited to OpenSSL) that is licensed under separate terms,
9 # as designated in a particular file or component or in included license
10 # documentation. The authors of MySQL hereby grant you an additional
11 # permission to link the program and your derivative works with the
12 # separately licensed software that they have either included with
13 # the program or referenced in the documentation.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License, version 2.0, for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
24 # We currently use clang-format version 15.
25 #
26 # This is the output of
27 #
28 # $ clang-format-10 --style=google --dump-config
29 #
30 # for C++ files except for changes mentioned below.
31 #
32 # For JavaScript files the output is generated by:
33 #
34 # $ clang-format-10 --assume-filename=format.js \
35 # --style=google --dump-config
36 #
37 # We lock the style so that any newer version of clang-format will give
38 # the same result; as time goes, we may update this list, requiring
39 # newer versions of clang-format.
40
41 ---
42 Language: Cpp
43 # BasedOnStyle: Google
44 AccessModifierOffset: -1
45 AlignAfterOpenBracket: Align
46 AlignConsecutiveMacros: false
47 AlignConsecutiveAssignments: false
48 AlignConsecutiveDeclarations: false
49 AlignEscapedNewlines: Left
50 AlignOperands: true
51 AlignTrailingComments: true
52 AllowAllArgumentsOnNextLine: true
53 AllowAllConstructorInitializersOnNextLine: true
54 AllowAllParametersOfDeclarationOnNextLine: true
55 AllowShortBlocksOnASingleLine: Never
56 AllowShortCaseLabelsOnASingleLine: false
57 AllowShortFunctionsOnASingleLine: All
58 AllowShortLambdasOnASingleLine: All
59 AllowShortIfStatementsOnASingleLine: WithoutElse
60 AllowShortLoopsOnASingleLine: true
61 AlwaysBreakAfterDefinitionReturnType: None
62 AlwaysBreakAfterReturnType: None
63 AlwaysBreakBeforeMultilineStrings: true
64 AlwaysBreakTemplateDeclarations: Yes
65 BinPackArguments: true
66 BinPackParameters: true
67 BraceWrapping:
68 AfterCaseLabel: false
69 AfterClass: false
70 AfterControlStatement: false
71 AfterEnum: false
72 AfterFunction: false
73 AfterNamespace: false
74 AfterObjCDeclaration: false
75 AfterStruct: false
76 AfterUnion: false
77 AfterExternBlock: false
78 BeforeCatch: false
79 BeforeElse: false
80 IndentBraces: false
81 SplitEmptyFunction: true
82 SplitEmptyRecord: true
83 SplitEmptyNamespace: true
84 BreakBeforeBinaryOperators: None
85 BreakBeforeBraces: Attach
86 BreakBeforeInheritanceComma: false
87 BreakInheritanceList: BeforeColon
88 BreakBeforeTernaryOperators: true
89 BreakConstructorInitializersBeforeComma: false
90 BreakConstructorInitializers: BeforeColon
91 BreakAfterJavaFieldAnnotations: false
92 BreakStringLiterals: true
93 ColumnLimit: 80
94 CommentPragmas: '^ IWYU pragma:'
95 CompactNamespaces: false
96 ConstructorInitializerAllOnOneLineOrOnePerLine: true
97 ConstructorInitializerIndentWidth: 4
98 ContinuationIndentWidth: 4
99 Cpp11BracedListStyle: true
100 DeriveLineEnding: true
101 DisableFormat: false
102 ExperimentalAutoDetectBinPacking: false
103 FixNamespaceComments: true
104 ForEachMacros:
105 - foreach
106 - Q_FOREACH
107 - BOOST_FOREACH
108 IncludeCategories:
109 - Regex: '^<ext/.*\.h>'
110 Priority: 2
111 SortPriority: 0
112 - Regex: '^<.*\.h>'
113 Priority: 1
114 SortPriority: 0
115 - Regex: '^<.*'
116 Priority: 2
117 SortPriority: 0
118 - Regex: '.*'
119 Priority: 3
120 SortPriority: 0
121 IncludeIsMainRegex: '([-_](test|unittest))?$'
122 IncludeIsMainSourceRegex: ''
123 IndentCaseLabels: true
124 IndentGotoLabels: true
125 IndentPPDirectives: None
126 IndentWidth: 2
127 IndentWrappedFunctionNames: false
128 JavaScriptQuotes: Leave
129 JavaScriptWrapImports: true
130 KeepEmptyLinesAtTheStartOfBlocks: false
131 MacroBlockBegin: ''
132 MacroBlockEnd: ''
133 MaxEmptyLinesToKeep: 1
134 NamespaceIndentation: None
135 ObjCBinPackProtocolList: Never
136 ObjCBlockIndentWidth: 2
137 ObjCSpaceAfterProperty: false
138 ObjCSpaceBeforeProtocolList: true
139 PenaltyBreakAssignment: 2
140 PenaltyBreakBeforeFirstCallParameter: 1
141 PenaltyBreakComment: 300
142 PenaltyBreakFirstLessLess: 120
143 PenaltyBreakString: 1000
144 PenaltyBreakTemplateDeclaration: 10
145 PenaltyExcessCharacter: 1000000
146 PenaltyReturnTypeOnItsOwnLine: 200
147 RawStringFormats:
148 - Language: Cpp
149 Delimiters:
150 - cc
151 - CC
152 - cpp
153 - Cpp
154 - CPP
155 - 'c++'
156 - 'C++'
157 CanonicalDelimiter: ''
158 BasedOnStyle: google
159 - Language: TextProto
160 Delimiters:
161 - pb
162 - PB
163 - proto
164 - PROTO
165 EnclosingFunctions:
166 - EqualsProto
167 - EquivToProto
168 - PARSE_PARTIAL_TEXT_PROTO
169 - PARSE_TEST_PROTO
170 - PARSE_TEXT_PROTO
171 - ParseTextOrDie
172 - ParseTextProtoOrDie
173 CanonicalDelimiter: ''
174 BasedOnStyle: google
175 ReflowComments: true
176 SortIncludes: true
177 SortUsingDeclarations: true
178 SpaceAfterCStyleCast: false
179 SpaceAfterLogicalNot: false
180 SpaceAfterTemplateKeyword: true
181 SpaceBeforeAssignmentOperators: true
182 SpaceBeforeCpp11BracedList: false
183 SpaceBeforeCtorInitializerColon: true
184 SpaceBeforeInheritanceColon: true
185 SpaceBeforeParens: ControlStatements
186 SpaceBeforeRangeBasedForLoopColon: true
187 SpaceInEmptyBlock: false
188 SpaceInEmptyParentheses: false
189 SpacesBeforeTrailingComments: 2
190 SpacesInAngles: false
191 SpacesInConditionalStatement: false
192 SpacesInContainerLiterals: true
193 SpacesInCStyleCastParentheses: false
194 SpacesInParentheses: false
195 SpacesInSquareBrackets: false
196 SpaceBeforeSquareBrackets: false
197 StatementMacros:
198 - Q_UNUSED
199 - QT_REQUIRE_VERSION
200 TabWidth: 8
201 UseCRLF: false
202 UseTab: Never
203
204 # We declare one specific pointer style since right alignment is dominant in
205 # the MySQL code base (default --style=google has DerivePointerAlignment true).
206 DerivePointerAlignment: false
207 PointerAlignment: Right
208
209 Standard: Latest
210
211 # MySQL includes frequently are not order-independent (e.g. my_config.h needs
212 # to go on top). This is unfortunate, but not something we can change easily,
213 # so we keep the clang-format 8 behavior of preserving blocks.
214 IncludeBlocks: Preserve
215 ---
216 Language: JavaScript
217 # BasedOnStyle: Google
218 AccessModifierOffset: -1
219 AlignAfterOpenBracket: AlwaysBreak
220 AlignConsecutiveMacros: false
221 AlignConsecutiveAssignments: false
222 AlignConsecutiveDeclarations: false
223 AlignEscapedNewlines: Left
224 AlignOperands: false
225 AlignTrailingComments: true
226 AllowAllArgumentsOnNextLine: true
227 AllowAllConstructorInitializersOnNextLine: true
228 AllowAllParametersOfDeclarationOnNextLine: true
229 AllowShortBlocksOnASingleLine: Never
230 AllowShortCaseLabelsOnASingleLine: false
231 AllowShortFunctionsOnASingleLine: Empty
232 AllowShortLambdasOnASingleLine: All
233 AllowShortIfStatementsOnASingleLine: WithoutElse
234 AllowShortLoopsOnASingleLine: true
235 AlwaysBreakAfterDefinitionReturnType: None
236 AlwaysBreakAfterReturnType: None
237 AlwaysBreakBeforeMultilineStrings: false
238 AlwaysBreakTemplateDeclarations: Yes
239 BinPackArguments: true
240 BinPackParameters: true
241 BraceWrapping:
242 AfterCaseLabel: false
243 AfterClass: false
244 AfterControlStatement: false
245 AfterEnum: false
246 AfterFunction: false
247 AfterNamespace: false
248 AfterObjCDeclaration: false
249 AfterStruct: false
250 AfterUnion: false
251 AfterExternBlock: false
252 BeforeCatch: false
253 BeforeElse: false
254 IndentBraces: false
255 SplitEmptyFunction: true
256 SplitEmptyRecord: true
257 SplitEmptyNamespace: true
258 BreakBeforeBinaryOperators: None
259 BreakBeforeBraces: Attach
260 BreakBeforeInheritanceComma: false
261 BreakInheritanceList: BeforeColon
262 BreakBeforeTernaryOperators: false
263 BreakConstructorInitializersBeforeComma: false
264 BreakConstructorInitializers: BeforeColon
265 BreakAfterJavaFieldAnnotations: false
266 BreakStringLiterals: true
267 ColumnLimit: 80
268 CommentPragmas: '(taze:|^/[ ]*<|@see)'
269 CompactNamespaces: false
270 ConstructorInitializerAllOnOneLineOrOnePerLine: true
271 ConstructorInitializerIndentWidth: 4
272 ContinuationIndentWidth: 4
273 Cpp11BracedListStyle: true
274 DeriveLineEnding: true
275 DisableFormat: false
276 ExperimentalAutoDetectBinPacking: false
277 FixNamespaceComments: true
278 ForEachMacros:
279 - foreach
280 - Q_FOREACH
281 - BOOST_FOREACH
282 IncludeCategories:
283 - Regex: '^<ext/.*\.h>'
284 Priority: 2
285 SortPriority: 0
286 - Regex: '^<.*\.h>'
287 Priority: 1
288 SortPriority: 0
289 - Regex: '^<.*'
290 Priority: 2
291 SortPriority: 0
292 - Regex: '.*'
293 Priority: 3
294 SortPriority: 0
295 IncludeIsMainRegex: '([-_](test|unittest))?$'
296 IncludeIsMainSourceRegex: ''
297 IndentCaseLabels: true
298 IndentGotoLabels: true
299 IndentPPDirectives: None
300 IndentWidth: 2
301 IndentWrappedFunctionNames: false
302 JavaScriptQuotes: Leave
303 JavaScriptWrapImports: false
304 KeepEmptyLinesAtTheStartOfBlocks: false
305 MacroBlockBegin: ''
306 MacroBlockEnd: ''
307 MaxEmptyLinesToKeep: 3
308 NamespaceIndentation: All
309 ObjCBinPackProtocolList: Never
310 ObjCBlockIndentWidth: 2
311 ObjCSpaceAfterProperty: false
312 ObjCSpaceBeforeProtocolList: true
313 PenaltyBreakAssignment: 2
314 PenaltyBreakBeforeFirstCallParameter: 1
315 PenaltyBreakComment: 300
316 PenaltyBreakFirstLessLess: 120
317 PenaltyBreakString: 1000
318 PenaltyBreakTemplateDeclaration: 10
319 PenaltyExcessCharacter: 1000000
320 PenaltyReturnTypeOnItsOwnLine: 200
321 RawStringFormats:
322 - Language: Cpp
323 Delimiters:
324 - cc
325 - CC
326 - cpp
327 - Cpp
328 - CPP
329 - 'c++'
330 - 'C++'
331 CanonicalDelimiter: ''
332 BasedOnStyle: google
333 - Language: TextProto
334 Delimiters:
335 - pb
336 - PB
337 - proto
338 - PROTO
339 EnclosingFunctions:
340 - EqualsProto
341 - EquivToProto
342 - PARSE_PARTIAL_TEXT_PROTO
343 - PARSE_TEST_PROTO
344 - PARSE_TEXT_PROTO
345 - ParseTextOrDie
346 - ParseTextProtoOrDie
347 CanonicalDelimiter: ''
348 BasedOnStyle: google
349 ReflowComments: true
350 SortIncludes: true
351 SortUsingDeclarations: true
352 SpaceAfterCStyleCast: false
353 SpaceAfterLogicalNot: false
354 SpaceAfterTemplateKeyword: true
355 SpaceBeforeAssignmentOperators: true
356 SpaceBeforeCpp11BracedList: false
357 SpaceBeforeCtorInitializerColon: true
358 SpaceBeforeInheritanceColon: true
359 SpaceBeforeParens: ControlStatements
360 SpaceBeforeRangeBasedForLoopColon: true
361 SpaceInEmptyBlock: false
362 SpaceInEmptyParentheses: false
363 SpacesBeforeTrailingComments: 2
364 SpacesInAngles: false
365 SpacesInConditionalStatement: false
366 SpacesInContainerLiterals: false
367 SpacesInCStyleCastParentheses: false
368 SpacesInParentheses: false
369 SpacesInSquareBrackets: false
370 SpaceBeforeSquareBrackets: false
371 StatementMacros:
372 - Q_UNUSED
373 - QT_REQUIRE_VERSION
374 TabWidth: 8
375 UseCRLF: false
376 UseTab: Never