-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
282 lines (278 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
---
#Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: 0
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCompound: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: true
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: false #TODO: Kommentare einer } ignorieren true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty # TODO: Wenn es wirklich "Allow" wäre: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All # TODO: [](){ call(); return; }
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros: []
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakAfterJavaFieldAnnotations: false
BreakArrays: false
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
ForEachMacros: []
IfMacros: []
IncludeBlocks: Regroup
# 1. Der eigene Header kommt automatisch oben (Prio 0)
# 2. Dann kommen lokale Header (Prio 10)
# 3. Dann kommen eigene Libraries in <> mit großen Buchstaben am Anfang und normalerweise einem / drin (Prio 20)
# 4. Dann kommen Interfaces (Prio 30)
# 4. Dann kommen 3rd Party ohne Qt in <>, leider muessen wir hier die Präfixe alle manuell angeben... (Prio 40)
# 5. Dann kommen die Qt Header in <> mit einem großen Q, gefolgt von einem weiteren großen Buchstaben, und ohne / (Prio 50)
# 6. Dann kommen OS-Header, durch den Regex fallen hier auch C-Header rein, aber diese sollen ja eh nicht verwendet werden. :) (Prio 60)
# 7. Zuletzt kommen die Std-Header (Prio 70)
# Die Regexe müssen anders sortiert sein, da der erste der passt die Prio vorgibt
# Der Abstand der Prios erlaubt es Unterprojekten bei Bedarf da noch etwas zwischen zu schieben.
IncludeCategories:
- Regex: '^<.*\.(grpc\.pb|capnp)\.h>$'
Priority: 30
SortPriority: 0
CaseSensitive: false
- Regex: '^<Q(t|t?[A-Z][^/]+)>$'
Priority: 50
SortPriority: 0
CaseSensitive: true
- Regex: '^<q[^/]+.h>$'
Priority: 50
SortPriority: 0
CaseSensitive: true
# - Regex: '^<(boost|catch2|ctre|date|fmt|gsl|safe|strong_type|toml\+\+|units)/.*/'
# Priority: 40
# SortPriority: 41
# CaseSensitive: true
- Regex: '^<(boost|catch2|ctre|date|Eigen|fmt|gsl|mp-units|safe|strong_type|toml\+\+)/'
Priority: 40
SortPriority: 40
CaseSensitive: true
- Regex: '^<[A-Z].*/'
Priority: 20
SortPriority: 0
CaseSensitive: true
- Regex: '^<.*\.h>'
Priority: 60
SortPriority: 0
CaseSensitive: false
- Regex: '^<'
Priority: 70
SortPriority: 0
CaseSensitive: false
- Regex: '^"\.\./\.\./.*'
Priority: 10
SortPriority: 14
CaseSensitive: false
- Regex: '^"\.\./[^/]+/.*'
Priority: 10
SortPriority: 13
CaseSensitive: false
- Regex: '^"\.\./.*'
Priority: 10
SortPriority: 12
CaseSensitive: false
- Regex: '^".*/'
Priority: 10
SortPriority: 11
CaseSensitive: false
- Regex: '^".*'
Priority: 10
SortPriority: 10
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentRequiresClause: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 4
BinaryMinDigits: 9
Decimal: 3
DecimalMinDigits: 9
Hex: 2
HexMinDigits: 9
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
KeepEmptyLinesAtEOF: true
#KeepLineBreaksForNonEmptyLines: false
LambdaBodyIndentation: Signature
LineEnding: DeriveCRLF
MacroBlockBegin: ''
MacroBlockEnd: ''
Macros: ["BENCHMARK(x)=[]()"]
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
PPIndentWidth: 2
QualifierAlignment: Custom
QualifierOrder: [static, inline, constexpr, const, volatile, type]
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: Keyword
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 0
SortIncludes: CaseInsensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: true
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: 0
SpacesInParens: Custom
SpacesInParensOptions:
InCStyleCasts: false
InConditionalStatements: true
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Latest
StatementAttributeLikeMacros: [emit]
StatementMacros: [Q_UNUSED, QT_REQUIRE_VERSION]
TabWidth: 4
UseTab: Never
WhitespaceSensitiveMacros: []
...
##TODO:
## static_assert(options.BaseTraceLevel == TraceLevel::Info);
## static_assert(options.MemoryLimit == SpaceType{50 * Units::MebiBytes});
## static_assert(sizeof...(args) == std::conditional_t<std::is_same_v<NewState, WaitingForVersions> ||
## std::is_same_v<NewState, WaitingForAck>,
## std::integral_constant<int, 1>,
## std::integral_constant<int, 0>>::value);
## static_assert(sizeof...(args) == std::conditional_t < std::is_same_v<NewState, WaitingForVersions> ||
## std::is_same_v<NewState, WaitingForAck>,
## std::integral_constant<int, 1>, std::integral_constant < int, 0 >> ::value);
##
# Alles oder nur 1. Zeile machtn Unterschied
## ret.Position += offset.dropDimensions<Dimension::A>();
## ret.Position = rotateAroundOrigin(ret.Position, offset.a());