-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
211 lines (193 loc) · 5.31 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
# clang-format 18.1.8
# Qt Coding Style: https://wiki.qt.io/Qt_Coding_Style
# Options: https://releases.llvm.org/18.1.8/tools/clang/docs/ClangFormatStyleOptions.html
---
Language: Cpp
Standard: c++20
ColumnLimit: 100
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign # for (), <>, []
AlignArrayOfStructures: Left
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: Left
# AlignEscapedNewlines: LeftWithLastLine # version >= 19
AlignOperands: DontAlign
AlignTrailingComments:
Kind: Leave
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never # always break if
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
[
Q_GRPC_EXPORT,
Q_GRPCQUICK_EXPORT,
Q_PROTOBUF_EXPORT,
Q_PROTOBUFQTCORETYPES_EXPORT,
Q_PROTOBUFQTGUITYPES_EXPORT,
Q_IMPLICIT,
Q_INVOKABLE,
]
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Never
BreakArrays: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom # Using BraceWrapping
BreakBeforeConceptDeclarations: Allowed
# BreakBeforeInlineASMColon:
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
CommentPragmas: "^ SPDX-License-Identifier:|^ Copyright|\\since|\\overload|\\reentrant|\\value|\\li|\\l"
CompactNamespaces: false
# ConstructorInitializerIndentWidth:
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
ForEachMacros:
[
forever,
foreach,
Q_FOREACH,
BOOST_FOREACH,
Q_FOREVER,
QBENCHMARK,
QBENCHMARK_ONCE,
]
# IfMacros:
IncludeBlocks: Preserve
IncludeCategories:
# Headers in "" with extension.
- Regex: '"([A-Za-z0-9.\/-_])+"'
Priority: 1
# Headers in <> starting with Qt
- Regex: "^<Qt*"
Priority: 2
# Headers in <> without extension.
- Regex: '<([a-z\/-_])+>'
Priority: 4
# Headers in <> with extension.
- Regex: '<([a-z.\/-_])+>'
Priority: 5
# IncludeCategories:
# IncludeIsMainRegex:
# IncludeIsMainSourceRegex:
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentGotoLabels: false
IndentPPDirectives: AfterHash
IndentRequiresClause: false
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None # Cannot be used with BinPackArguments
IntegerLiteralSeparator:
Binary: 0
Decimal: 3
DecimalMinDigits: 5
Hex: 2
HexMinDigits: 6
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
LineEnding: LF
Macros:
- Q_DISABLE_COPY_MOVE(x)=x;
- Q_DECLARE_PRIVATE(x)=x;
- Q_OBJECT=x;
MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner
PPIndentWidth: 2
PackConstructorInitializers: NextLineOnly
PenaltyBreakAssignment: 1000
PenaltyBreakBeforeFirstCallParameter: 10
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 20
PenaltyBreakOpenParenthesis: 25
PenaltyBreakScopeResolution: 1000
PenaltyBreakString: 100
PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 1000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 25
PointerAlignment: Right
QualifierAlignment: Left
ReferenceAlignment: Right
ReflowComments: false
RemoveBracesLLVM: true
RemoveParentheses: Leave
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
# SeparateDefnitionBlocks:
ShortNamespaceLines: 4
SkipMacroDefinitionBody: true
SortIncludes: CaseSensitive
SortUsingDeclarations: Lexicographic
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default # use PointerAlignment
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: true
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInParens: Never
SpacesInSquareBrackets: false
StatementAttributeLikeMacros: [emit]
StatementMacros: [Q_UNUSED]
UseTab: Never
WhitespaceSensitiveMacros: [Q_PROPERTY]
---
# Use the Google-based style for .proto files.
Language: Proto
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 100