-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
288 lines (217 loc) · 8.35 KB
/
.clang-format
File metadata and controls
288 lines (217 loc) · 8.35 KB
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
---
#########################################################################################
# Tencent C++ code style
Language: Cpp
BasedOnStyle: Google
# If true, analyze the formatted file for the most common alignment of & and *
DerivePointerAlignment: false
PointerAlignment: Right
# Only sort headers in each include block
SortIncludes: true
IncludeBlocks: Preserve
# Indents directives after the hash e.g.,
# #if defined(WIN)
# # include <windows.h>
# #else
# # include <curl.h>
# #endif
# IndentPPDirectives: AfterHash
#########################################################################################
# XNet specific C++ code style
# The extra indent or outdent of access modifiers, e.g. public:
# [NOTE] Tencent requires: -3
AccessModifierOffset: -4
# Horizontally aligns arguments after an open bracket?
AlignAfterOpenBracket: AlwaysBreak
# Style of aligning consecutive bit field
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
# Style of aligning consecutive declarations
#AlignConsecutiveDeclarations: None
# Style of aligning consecutive macro definitions
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
# Dependent on the value, int f() { return 0; } can be put on a single line
AllowShortFunctionsOnASingleLine: None
# Dependent on the value, if (a) return; can be put on a single line
AllowShortIfStatementsOnASingleLine: Never
# Dependent on the value, auto lambda []() { return 0; } can be put on a single line
AllowShortLambdasOnASingleLine: All
# If true, while (true) continue; can be put on a single line
AllowShortLoopsOnASingleLine: false
# Aligns trailing comments?
AlignTrailingComments: false
# Always break before multiline string literals?
AlwaysBreakBeforeMultilineStrings: true
# The template declaration breaking style to use
AlwaysBreakTemplateDeclarations: true
# Control of individual brace wrapping cases, valid when BreakBeforeBraces is Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
# The brace breaking style to use. Candidates: Custom, Allman, Attach
# [NOTE] Tencent requires: Attach
BreakBeforeBraces: Custom
# Ternary operators will be placed after line breaks?
BreakBeforeTernaryOperators: false
# The constructor initializers style to use
BreakConstructorInitializers: BeforeComma
# The column limit. A column limit of 0 means that there is no column limit
ColumnLimit: 88
# Consecutive namespace declarations will be on the same line?
CompactNamespaces: false
# Analyze the formatted file for the most used line ending
DeriveLineEnding: true
# Adds missing namespace end comments and fixes invalid existing ones?
FixNamespaceComments: true
# Indent case label blocks one level from the case label
IndentCaseBlocks: true
# Indent case labels one level from the switch statement
IndentCaseLabels: false
# IndentExternBlockStyle is the type of indenting of extern blocks
IndentExternBlock: NoIndent
# The preprocessor directive indenting style to use
IndentPPDirectives: None
# The number of columns to use for indentation
IndentWidth: 4
# Indent if a function definition or declaration is wrapped after the type
IndentWrappedFunctionNames: false
# A regular expression matching macros that start a block
MacroBlockBegin: 'XNET_SREFLECT_(STRUCT|UNION)_BEGIN'
# A regular expression matching macros that end a block
MacroBlockEnd: 'XNET_SREFLECT_(STRUCT|UNION)_END'
# The maximum number of consecutive empty lines to keep
#MaxEmptyLinesToKeep: 1
# Attempt to re-flow comments?
ReflowComments: false
# A space will be inserted after the ‘template’ keyword?
SpaceAfterTemplateKeyword: true
Standard: Auto
# The way to use tab characters in the resulting file
UseTab: Never
---
#########################################################################################
# Tencent Objective C++ code style
Language: ObjC
BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
# AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine : false
AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
ColumnLimit: 88
CommentPragmas: '^ IWYU pragma:'
PointerAlignment: Right
IndentWidth: 4
MaxEmptyLinesToKeep: 1
ObjCBreakBeforeNestedBlockParam: false
ObjCSpaceAfterProperty: true
ObjCBlockIndentWidth: 4
SpacesInSquareBrackets: false
SpacesInParentheses : false
SpaceBeforeAssignmentOperators: true
SpacesInContainerLiterals: false
# IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
SpaceAfterCStyleCast: false
SortIncludes: false
# IndentCaseLabels: true
# BreakBeforeBraces: Attach
TabWidth: 4
UseTab: Never
#########################################################################################
# XNet specific Objective C++ code style
# Horizontally aligns arguments after an open bracket?
AlignAfterOpenBracket: AlwaysBreak
# Style of aligning consecutive bit field
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
# Style of aligning consecutive macro definitions
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
# Dependent on the value, int f() { return 0; } can be put on a single line
AllowShortFunctionsOnASingleLine: None
# Dependent on the value, auto lambda []() { return 0; } can be put on a single line
AllowShortLambdasOnASingleLine: All
# Aligns trailing comments?
AlignTrailingComments: false
# Always break before multiline string literals?
AlwaysBreakBeforeMultilineStrings: true
# The template declaration breaking style to use
AlwaysBreakTemplateDeclarations: true
# Control of individual brace wrapping cases, valid when BreakBeforeBraces is Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
# The brace breaking style to use. Candidates: Custom, Allman, Attach
# [NOTE] Tencent requires: Attach
BreakBeforeBraces: Custom
# Ternary operators will be placed after line breaks?
BreakBeforeTernaryOperators: false
# The constructor initializers style to use
BreakConstructorInitializers: BeforeComma
# Consecutive namespace declarations will be on the same line?
CompactNamespaces: false
# Analyze the formatted file for the most used line ending
DeriveLineEnding: true
# Adds missing namespace end comments and fixes invalid existing ones?
FixNamespaceComments: true
# Indent case label blocks one level from the case label
IndentCaseBlocks: true
# Indent case labels one level from the switch statement
IndentCaseLabels: false
# IndentExternBlockStyle is the type of indenting of extern blocks
IndentExternBlock: NoIndent
# The preprocessor directive indenting style to use
IndentPPDirectives: None
# Indent if a function definition or declaration is wrapped after the type
IndentWrappedFunctionNames: false
# A regular expression matching macros that start a block
MacroBlockBegin: 'XNET_SREFLECT_(STRUCT|UNION)_BEGIN'
# A regular expression matching macros that end a block
MacroBlockEnd: 'XNET_SREFLECT_(STRUCT|UNION)_END'
# The indentation used for namespaces
NamespaceIndentation: None
# Attempt to re-flow comments?
ReflowComments: false
# A space will be inserted after the ‘template’ keyword?
SpaceAfterTemplateKeyword: true
Standard: Auto