forked from AirenSoft/OvenMediaEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
337 lines (321 loc) · 9.14 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
333
334
335
336
337
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
# The column limit.
#
# A column limit of 0 means that there is no column limit. In this case, clang-format will respect the input’s line breaking decisions within statements unless they contradict other rules.
ColumnLimit: 0
# The number of columns to use for indentation.
#
# IndentWidth: 3
#
# void f() {
# someFunction();
# if (true, false) {
# f();
# }
# }
IndentWidth: '4'
# The extra indent or outdent of access modifiers, e.g. public:.
AccessModifierOffset: -4
# Allow breaking string literals when formatting.
BreakStringLiterals: false
# The number of columns used for tab stops.
TabWidth: '4'
# The way to use tab characters in the resulting file.
#
# Possible values:
#
# UT_Never (in configuration: Never) Never use tab.
# UT_ForIndentation (in configuration: ForIndentation) Use tabs only for indentation.
# UT_ForContinuationAndIndentation (in configuration: ForContinuationAndIndentation) Use tabs only for line continuation and indentation.
# UT_Always (in configuration: Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one.
UseTab: Always
# Options for aligning backslashes in escaped newlines.
#
# Possible values:
#
# ENAS_DontAlign (in configuration: DontAlign) Don’t align escaped newlines.
# #define A \
# int aaaa; \
# int b; \
# int dddddddddd;
#
# ENAS_Left (in configuration: Left) Align escaped newlines as far left as possible.
# #define A \
# int aaaa; \
# int b; \
# int dddddddddd;
#
# ENAS_Right (in configuration: Right) Align escaped newlines in the right-most column.
# #define A \
# int aaaa; \
# int b; \
# int dddddddddd;
AlignEscapedNewlines: Left
# Dependent on the value, int f() { return 0; } can be put on a single line.
#
# Possible values:
#
# SFS_None (in configuration: None) Never merge functions into a single line.
#
# SFS_InlineOnly (in configuration: InlineOnly) Only merge functions defined inside a class. Same as “inline”, except it does not implies “empty”: i.e. top level empty functions are not merged either.
# class Foo {
# void f() { foo(); }
# };
# void f() {
# foo();
# }
# void f() {
# }
#
# SFS_Empty (in configuration: Empty) Only merge empty functions.
# void f() {}
# void f2() {
# bar2();
# }
#
# SFS_Inline (in configuration: Inline) Only merge functions defined inside a class. Implies “empty”.
# class Foo {
# void f() { foo(); }
# };
# void f() {
# foo();
# }
# void f() {}
#
# SFS_All (in configuration: All) Merge all functions fitting on a single line.
# class Foo {
# void f() { foo(); }
# };
# void f() { bar(); }
AllowShortFunctionsOnASingleLine: Empty
# If true, if (a) return; can be put on a single line.
#
# Possible values:
#
# SIS_Never (in configuration: Never) Never put short ifs on the same line.
# if (a)
# return ;
# else {
# return;
# }
#
# SIS_WithoutElse (in configuration: WithoutElse) Without else put short ifs on the same line only if the else is not a compound statement.
# if (a) return;
# else
# return;
#
# SIS_Always (in configuration: Always) Always put short ifs on the same line if the else is not a compound statement or not.
# if (a) return;
# else {
# return;
# }
AllowShortIfStatementsOnASingleLine: 'false'
# If true, while (true) continue; can be put on a single line.
AllowShortLoopsOnASingleLine: 'false'
# The preprocessor directive indenting style to use.
#
# Possible values:
#
# PPDIS_None (in configuration: None) Does not indent any directives.
# #if FOO
# #if BAR
# #include <foo>
# #endif
# #endif
#
# PPDIS_AfterHash (in configuration: AfterHash) Indents directives after the hash.
# #if FOO
# # if BAR
# # include <foo>
# # endif
# #endif
#
# PPDIS_BeforeHash (in configuration: BeforeHash) Indents directives before the hash.
# #if FOO
# #if BAR
# #include <foo>
# #endif
# #endif
IndentPPDirectives: AfterHash
# The brace breaking style to use.
#
# Possible values:
#
# BS_Attach (in configuration: Attach) Always attach braces to surrounding context.
# try {
# foo();
# } catch () {
# }
# void foo() { bar(); }
# class foo {};
# if (foo()) {
# } else {
# }
# enum X : int { A, B };
#
# BS_Linux (in configuration: Linux) Like Attach, but break before braces on function, namespace and class definitions.
# try {
# foo();
# } catch () {
# }
# void foo() { bar(); }
# class foo
# {
# };
# if (foo()) {
# } else {
# }
# enum X : int { A, B };
#
# BS_Mozilla (in configuration: Mozilla) Like Attach, but break before braces on enum, function, and record definitions.
# try {
# foo();
# } catch () {
# }
# void foo() { bar(); }
# class foo
# {
# };
# if (foo()) {
# } else {
# }
# enum X : int { A, B };
#
# BS_Stroustrup (in configuration: Stroustrup) Like Attach, but break before function definitions, catch, and else.
# try {
# foo();
# }
# catch () {
# }
# void foo() { bar(); }
# class foo {
# };
# if (foo()) {
# }
# else {
# }
# enum X : int { A, B };
#
# BS_Allman (in configuration: Allman) Always break before braces.
# try
# {
# foo();
# }
# catch ()
# {
# }
# void foo() { bar(); }
# class foo
# {
# };
# if (foo())
# {
# }
# else
# {
# }
# enum X : int
# {
# A,
# B
# };
#
# BS_GNU (in configuration: GNU) Always break before braces and add an extra level of indentation to braces of control statements, not to those of class, function or other definitions.
# try
# {
# foo();
# }
# catch ()
# {
# }
# void foo() { bar(); }
# class foo
# {
# };
# if (foo())
# {
# }
# else
# {
# }
# enum X : int
# {
# A,
# B
# };
#
# BS_WebKit (in configuration: WebKit) Like Attach, but break before functions.
# try {
# foo();
# } catch () {
# }
# void foo() { bar(); }
# class foo {
# };
# if (foo()) {
# } else {
# }
# enum X : int { A, B };
#
# BS_Custom (in configuration: Custom) Configure each individual brace in BraceWrapping.
BreakBeforeBraces: Custom
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
AfterExternBlock : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
SplitEmptyFunction : 'false'
SplitEmptyRecord : 'true'
SplitEmptyNamespace : 'true'
}
# The indentation used for namespaces.
#
# Possible values:
#
# NI_None (in configuration: None) Don’t indent in namespaces.
# namespace out {
# int i;
# namespace in {
# int i;
# }
# }
#
# NI_Inner (in configuration: Inner) Indent only in inner namespaces (nested in other namespaces).
# namespace out {
# int i;
# namespace in {
# int i;
# }
# }
#
# NI_All (in configuration: All) Indent in all namespaces.
# namespace out {
# int i;
# namespace in {
# int i;
# }
# }
NamespaceIndentation: All
# If true, clang-format will attempt to re-flow comments.
#
# false:
# // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information
# /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */
#
# true:
# // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
# // information
# /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
# * information */
ReflowComments: false
# https://reviews.llvm.org/D33029
# The current version doesn't support this option, but I put it for later.
# DanglingParenthesis: false