-
Notifications
You must be signed in to change notification settings - Fork 0
/
uncrustify.cfg
381 lines (270 loc) · 16 KB
/
uncrustify.cfg
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
#########################################################################################################
# An Uncrustify configuration file to match the #
# official tiknil.com Objective-C style guide. #
# #
# https://github.com/tiknil/objective-c-style-guide/ #
#########################################################################################################
#########################################################################################################
### GENERAL OPTIONS ###
#########################################################################################################
# The type of line endings
newlines = auto # auto/lf/crlf/cr
# The original size of tabs in the input
input_tab_size = 8 # number
# The size of tabs in the output (only used if align_with_tabs=true)
output_tab_size = 8 # number
# The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn)
string_escape_char = 92 # number
# Alternate string escape char for Pawn. Only works right before the quote char.
string_escape_char2 = 0 # number
# Replace tab characters found in string literals with the escape sequence \t instead.
string_replace_tab_chars = false # false/true
# Allow interpreting '>=' and '>>=' as part of a template in 'void f(list<list<B>>=val);'.
# If true (default), 'assert(x<0 && y>=3)' will be broken.
# Improvements to template detection may make this option obsolete.
tok_split_gte = false # false/true
# Override the default ' *INDENT-OFF*' in comments for disabling processing of part of the file.
disable_processing_cmt = "" # string
# Override the default ' *INDENT-ON*' in comments for enabling processing of part of the file.
enable_processing_cmt = "" # string
# Control what to do with the UTF-8 BOM (recommend 'remove')
utf8_bom = remove # ignore/add/remove/force
# If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8
utf8_byte = false # false/true
# Force the output encoding to UTF-8
utf8_force = false # false/true
#########################################################################################################
### INDENT ###
#########################################################################################################
# Indent OC blocks at brace level instead of usual rules.
indent_oc_block = false # false/true
# Indent OC blocks in a message relative to the parameter name.
# 0=use indent_oc_block rules, 1+=spaces to indent
indent_oc_block_msg = 1 # number
# Minimum indent for subsequent parameters
indent_oc_msg_colon = 0 # number
# The number of columns to indent per level.
# Usually 2, 3, 4, or 8.
indent_columns = 4 # number
# The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents.
# For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level
indent_continue = 2 # number
# How to use tabs when indenting code
# 0=spaces only
# 1=indent with tabs to brace level, align with spaces
# 2=indent and align with tabs, using spaces when not on a tabstop
indent_with_tabs = 1 # number //indent_with_tabs = 0
# Comments that are not a brace level are indented with tabs on a tabstop.
# Requires indent_with_tabs=2. If false, will use spaces.
indent_cmt_with_tabs = false # false/true
# Whether to indent strings broken by '\' so that they line up
indent_align_string = false # false/true
indent_xml_string = 0
# Spaces to indent '{' from level
indent_brace = 0 # number
# Whether braces are indented to the body level
indent_braces = false # false/true
# Disabled indenting function braces if indent_braces is true
indent_braces_no_func = false # false/true
# Disabled indenting class braces if indent_braces is true
indent_braces_no_class = false # false/true
# Disabled indenting struct braces if indent_braces is true
indent_braces_no_struct = false # false/true
# Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc.
indent_brace_parent = false # false/true
indent_namespace = false
indent_namespace_level = 0
indent_namespace_limit = 0
indent_extern = true
indent_class = true
indent_class_colon = false
indent_ctor_init_leading = 2
indent_ctor_init = 0
# False=treat 'else\nif' as 'else if' for indenting purposes
# True=indent the 'if' one level
indent_else_if = false # false/true
# Amount to indent variable declarations after a open brace. neg=relative, pos=absolute
indent_var_def_blk = 0 # number
# Indent continued variable declarations instead of aligning.
indent_var_def_cont = false # false/true
# True: force indentation of function definition to start in column 1
# False: use the default behavior
indent_func_def_force_col1 = false # false/true
# True: indent continued function call parameters one indent level
# False: align parameters under the open paren
indent_func_call_param = false # false/true
# Same as indent_func_call_param, but for function defs
indent_func_def_param = true # false/true
# Same as indent_func_call_param, but for function protos
indent_func_proto_param = false # false/true
# Same as indent_func_call_param, but for class declarations
indent_func_class_param = false # false/true
# Same as indent_func_call_param, but for class variable constructors
indent_func_ctor_var_param = false # false/true
# Same as indent_func_call_param, but for templates
indent_template_param = false # false/true
# Double the indent for indent_func_xxx_param options
indent_func_param_double = false # false/true
# Indentation column for standalone 'const' function decl/proto qualifier
indent_func_const = 0 # number
# Indentation column for standalone 'throw' function decl/proto qualifier
indent_func_throw = 0 # number
# The number of spaces to indent a continued '->' or '.'
# Usually set to 0, 1, or indent_columns.
indent_member = 0 # number
# Spaces to indent single line ('//') comments on lines before code
indent_sing_line_comments = 0 # number
# If set, will indent trailing single line ('//') comments relative
# to the code instead of trying to keep the same absolute column
indent_relative_single_line_comments = false # false/true
# Spaces to indent 'case' from 'switch'
# Usually 0 or indent_columns.
indent_switch_case = 4 # number
# Spaces to shift the 'case' line, without affecting any other lines
# Usually 0.
indent_case_shift = 0 # number
# Spaces to indent '{' from 'case'.
# By default, the brace will appear under the 'c' in case.
# Usually set to 0 or indent_columns.
indent_case_brace = 0 # number
# Whether to indent comments found in first column
indent_col1_comment = false # false/true
indent_label = 1
indent_access_spec = 1
indent_access_spec_body = false
indent_paren_nl = false
indent_paren_close = 0
indent_comma_paren = false
indent_bool_paren = false
indent_first_bool_expr = false
indent_square_nl = false
indent_preserve_sql = false
indent_align_assign = true
#########################################################################################################
### SPACING ###
#########################################################################################################
# Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;'
sp_after_oc_scope = add # ignore/add/remove/force
# Add or remove space after the colon in message specs
# '-(int) f:(int) x;' vs '-(int) f: (int) x;'
sp_after_oc_colon = remove # ignore/add/remove/force
# Add or remove space before the colon in message specs
# '-(int) f: (int) x;' vs '-(int) f : (int) x;'
sp_before_oc_colon = remove # ignore/add/remove/force
# Add or remove space after the colon in immutable dictionary expression
# 'NSDictionary *test = @{@"foo" :@"bar"};'
sp_after_oc_dict_colon = add # ignore/add/remove/force
# Add or remove space before the colon in immutable dictionary expression
# 'NSDictionary *test = @{@"foo" :@"bar"};'
sp_before_oc_dict_colon = add # ignore/add/remove/force
# Add or remove space after the colon in message specs
# '[object setValue:1];' vs '[object setValue: 1];'
sp_after_send_oc_colon = remove # ignore/add/remove/force
# Add or remove space before the colon in message specs
# '[object setValue:1];' vs '[object setValue :1];'
sp_before_send_oc_colon = remove # ignore/add/remove/force
# Add or remove space after the (type) in message specs
# '-(int)f: (int) x;' vs '-(int)f: (int)x;'
sp_after_oc_type = remove # ignore/add/remove/force
# Add or remove space after the first (type) in message specs
# '-(int) f:(int)x;' vs '-(int)f:(int)x;'
sp_after_oc_return_type = add # ignore/add/remove/force
# Add or remove space between '@selector' and '('
# '@selector(msgName)' vs '@selector (msgName)'
# Also applies to @protocol() constructs
sp_after_oc_at_sel = remove # ignore/add/remove/force
# Add or remove space between '@selector(x)' and the following word
# '@selector(foo) a:' vs '@selector(foo)a:'
sp_after_oc_at_sel_parens = add # ignore/add/remove/force
# Add or remove space inside '@selector' parens
# '@selector(foo)' vs '@selector( foo )'
# Also applies to @protocol() constructs
sp_inside_oc_at_sel_parens = remove # ignore/add/remove/force
# Add or remove space before a block pointer caret
# '^int (int arg){...}' vs. ' ^int (int arg){...}'
sp_before_oc_block_caret = ignore # ignore/add/remove/force
# Add or remove space after a block pointer caret
# '^int (int arg){...}' vs. '^ int (int arg){...}'
sp_after_oc_block_caret = remove # ignore/add/remove/force
# Add or remove space between the receiver and selector in a message.
# '[receiver selector ...]'
sp_after_oc_msg_receiver = add # ignore/add/remove/force
# Add or remove space after @property.
sp_after_oc_property = force # ignore/add/remove/force
# Add or remove space between return type and function name
# A minimum of 1 is forced except for pointer return types.
sp_type_func = force # ignore/add/remove/force
# Add or remove space inside '{}'
sp_inside_braces_empty = ignore # ignore/add/remove/force
# Add or remove space inside '(' and ')'
sp_inside_paren = remove # ignore/add/remove/force
# Add or remove space between ')' and '{'
sp_paren_brace = force
# Add or remove space before pointer star '*'
sp_before_ptr_star = force # ignore/add/remove/force
# Add or remove space before pointer star '*' that isn't followed by a variable name
# If set to 'ignore', sp_before_ptr_star is used instead.
sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force
# Add or remove space between pointer stars '*'
sp_between_ptr_star = remove # ignore/add/remove/force
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star = remove # ignore/add/remove/force
# Add or remove space between function name and '(' on function calls
sp_func_call_paren = remove # ignore/add/remove/force
nl_after_func_body = 2
# Whether to remove blank lines after '{'
eat_blanks_after_open_brace = false # false/true
# Whether to remove blank lines before '}'
eat_blanks_before_close_brace = false # false/true
# If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace.
mod_move_case_break = false # false/true
# Will add or remove the braces around a fully braced case statement.
# Will only remove the braces if there are no variable declarations in the block.
mod_case_brace = ignore # ignore/add/remove/force
#########################################################################################################
### Newline adding and removing options ###
#########################################################################################################
# Whether to collapse empty blocks between '{' and '}'
nl_collapse_empty_body = false # false/true
# Don't split one-line braced assignments - 'foo_t f = { 1, 2 };'
nl_assign_leave_one_liners = true # false/true
nl_enum_brace = remove
nl_struct_brace = remove
nl_union_brace = remove
# Add or remove newline between 'if' and '{'
nl_if_brace = remove # ignore/add/remove/force
# Add or remove newline between '}' and 'else'
nl_brace_else = remove # ignore/add/remove/force
# Add or remove newline between 'else if' and '{'
# If set to ignore, nl_if_brace is used instead
nl_elseif_brace = remove # ignore/add/remove/force
# Add or remove newline between 'else' and '{'
nl_else_brace = remove # ignore/add/remove/force
# Add or remove newline between 'else' and 'if'
nl_else_if = remove # ignore/add/remove/force
nl_for_brace = remove
nl_while_brace = remove
nl_func_decl_end = remove
nl_func_def_end = remove
nl_fcall_brace = remove
# Add or remove a newline between a case ':' and '{'. Overrides nl_after_case.
nl_case_colon_brace = remove # ignore/add/remove/force
# Add or remove newline between function signature and '{'
nl_fdef_brace = force # ignore/add/remove/force
# The number of newlines between a function def and the function comment.
# 0 = No change.
nl_comment_func_def = 0 # number
#########################################################################################################
### ALIGN OPTIONS ###
#########################################################################################################
# Whether to align any attribute after the variable name
align_var_def_attribute = true # false/true
# Align variable definitions in prototypes and functions
align_func_params = true # false/true
# Span for aligning parameters in an Obj-C message call on the ':' (0=don't align)
align_oc_msg_colon_span = 1 # number
# Aligning parameters in an Obj-C '+' or '-' declaration on the ':'
align_oc_decl_colon = true # false/true
#########################################################################################################
### Comment modifications ###
#########################################################################################################