-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuncrustify.cfg
449 lines (379 loc) · 19.4 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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
#########################################################################################
# Description: #
# https://raw.githubusercontent.com/bengardner/uncrustify/master/etc/defaults.cfg #
#########################################################################################
utf8_bom = remove
# Indenting
indent_columns = 4
indent_with_tabs = 0
indent_cmt_with_tabs = false
indent_align_string = true
indent_extern = true
indent_func_def_force_col1 = true
indent_func_call_param = true
indent_func_def_param = true
indent_func_proto_param = true
indent_func_param_double = true
indent_relative_single_line_comments = true
indent_case_brace = 0
indent_sing_line_comments = 0
# Spacing options
sp_arith = force
sp_assign = force
sp_assign_default = force
sp_enum_assign = force
sp_bool = force
sp_compare = force
sp_paren_brace = force
sp_before_ptr_star = force
sp_before_unnamed_ptr_star = ignore
sp_between_ptr_star = remove
sp_after_ptr_star = remove
sp_after_ptr_star_qualifier = ignore
sp_after_ptr_star_func = ignore
sp_ptr_star_paren = force
sp_before_ptr_star_func = ignore
sp_after_byref = remove
sp_after_type = force
sp_inside_angle = remove
sp_before_sparen = force
sp_inside_sparen = remove
sp_after_sparen = force
sp_sparen_brace = force
sp_before_semi = remove
sp_special_semi = force
sp_before_semi_for = remove
sp_after_semi = add
sp_after_semi_for = force
sp_before_semi_for_empty = remove
sp_after_semi_for_empty = remove
sp_inside_square = remove
sp_after_comma = force
sp_before_comma = remove
sp_paren_comma = force
sp_after_cast = force
sp_inside_paren_cast = remove
sp_sizeof_paren = remove
sp_type_func = force
sp_func_proto_paren = remove
sp_func_def_paren = remove
sp_inside_braces_enum = force
sp_inside_braces_struct = force
sp_inside_braces = force
sp_inside_braces_empty = add
sp_func_def_paren = remove
sp_inside_fparens = remove
sp_inside_fparen = remove
sp_fparen_brace = force
sp_func_call_paren = remove
sp_attribute_paren = force
sp_macro = force
sp_macro_func = force
sp_else_brace = force
sp_brace_else = force
sp_brace_typedef = force
sp_not = remove
sp_inv = remove
sp_addr = remove
sp_member = remove
sp_deref = remove
sp_sign = remove
sp_incdec = remove
sp_before_nl_cont = add
sp_cond_colon = force
sp_cond_question = force
sp_case_label = force
sp_num_before_tr_emb_cmt = 1
sp_return_paren = remove
# Code alignment
align_keep_tabs = false
align_with_tabs = false
align_on_tabstop = false
# align_number_left = false
align_keep_extra_space = true
align_func_params = true
align_same_func_call_params = true
align_var_def_span = 1
align_var_def_thresh = 4
align_var_def_star_style = 1
align_var_def_amp_style = 1
align_var_def_gap = 1
align_var_def_colon = true
align_var_def_attribute = true
align_var_def_inline = true
align_assign_span = 1
align_assign_thresh = 1
align_enum_equ_span = 1
align_enum_equ_thresh = 0
align_var_struct_span = 1
align_var_struct_thresh = 16
align_var_struct_gap = 0
align_struct_init_span = 1
align_typedef_gap = 1
align_typedef_span = 1
align_typedef_func = 0
align_typedef_star_style = 2
align_typedef_amp_style = 2
align_right_cmt_span = 2
align_right_cmt_mix = true
align_right_cmt_gap = 8
align_right_cmt_at_col = 0
align_func_proto_span = 1
align_func_proto_gap = 1
align_on_operator = false
align_nl_cont = true
align_pp_define_together = true
align_pp_define_gap = 1
align_pp_define_span = 1
# Comment modifications
cmt_width = 0
cmt_reflow_mode = 0
cmt_convert_tab_to_spaces = true
cmt_indent_multi = false
cmt_c_group = false
cmt_star_cont = false
cmt_sp_before_star_cont = 0
cmt_sp_after_star_cont = 0
cmt_multi_check_last = true
cmt_star_cont = true
cmt_sp_before_star_cont = 4
# Newline adding and removing options
nl_collapse_empty_body = true
nl_func_leave_one_liners = true
nl_end_of_file = force
nl_end_of_file_min = 1
nl_func_var_def_blk = 1
nl_var_def_blk_in = 2
nl_if_brace = remove
nl_brace_else = remove
nl_elseif_brace = remove
nl_else_brace = remove
nl_else_if = remove
nl_for_brace = remove
nl_while_brace = remove
nl_do_brace = remove
nl_brace_while = remove
nl_switch_brace = remove
nl_multi_line_cond = true
nl_case_colon_brace = force
nl_func_type_name = force
nl_func_proto_type_name = remove
nl_func_paren = remove
nl_func_def_paren = remove
nl_func_decl_end = remove
nl_func_def_end = remove
nl_func_decl_empty = remove
nl_func_def_empty = remove
nl_fdef_brace = force
nl_return_expr = remove
nl_after_semicolon = true
nl_before_if = ignore
nl_after_if = ignore
nl_before_for = ignore
nl_after_for = ignore
nl_before_while = ignore
nl_after_while = ignore
nl_before_switch = ignore
nl_after_switch = ignore
nl_before_do = ignore
nl_after_do = force
nl_ds_struct_enum_cmt = false
nl_create_if_one_liner = false
nl_create_for_one_liner = false
nl_create_while_one_liner = false
nl_if_leave_one_liners = true
nl_while_leave_one_liners = true
# CPP
indent_namespace = true
indent_namespace_single_indent = true
indent_namespace_level = 1
nl_namespace_brace = remove
indent_access_spec_body = true
indent_access_spec = 0
# Code modifying options (non-whitespace)
mod_full_brace_do = force
mod_full_brace_for = force
mod_full_brace_function = force
mod_full_brace_if = force
mod_full_brace_if_chain = false
mod_full_brace_while = force
mod_paren_on_return = remove
mod_full_paren_if_bool = false
mod_remove_extra_semicolon = true
mod_move_case_break = true
mod_case_brace = add
#
# Positioning options
#
# The position of arithmetic operators in wrapped expressions
pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of assignment in wrapped expressions.
# Do not affect '=' followed by '{'
pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of boolean operators in wrapped expressions
pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of comparison operators in wrapped expressions
pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of conditional (b ? t : f) operators in wrapped expressions
pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of the comma in wrapped expressions
pos_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of the comma in the class base list
pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of the comma in the constructor initialization list
pos_constr_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of colons between class and base class list
pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
# The position of colons between constructor and member initialization
pos_constr_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
#
# Line Splitting options
#
# Try to limit code width to N number of columns
code_width = 0 # number
# Whether to fully split long 'for' statements at semi-colons
ls_for_split_full = false # false/true
# Whether to fully split long function protos/calls at commas
ls_func_split_full = false # false/true
# Whether to split lines as close to code_width as possible and ignore some groupings
ls_code_width = false # false/true
#
# Blank line options
#
# The maximum consecutive newlines
nl_max = 0 # number
# The number of newlines after a function prototype, if followed by another function prototype
nl_after_func_proto = 0 # number
# The number of newlines after a function prototype, if not followed by another function prototype
nl_after_func_proto_group = 0 # number
# The number of newlines after '}' of a multi-line function body
nl_after_func_body = 0 # number
# The number of newlines after '}' of a multi-line function body in a class declaration
nl_after_func_body_class = 0 # number
# The number of newlines after '}' of a single line function body
nl_after_func_body_one_liner = 0 # number
# The minimum number of newlines before a multi-line comment.
# Doesn't apply if after a brace open or another multi-line comment.
nl_before_block_comment = 0 # number
# The minimum number of newlines before a single-line C comment.
# Doesn't apply if after a brace open or other single-line C comments.
nl_before_c_comment = 0 # number
# The minimum number of newlines before a CPP comment.
# Doesn't apply if after a brace open or other CPP comments.
nl_before_cpp_comment = 0 # number
# Whether to force a newline after a multi-line comment.
nl_after_multiline_comment = false # false/true
# Whether to force a newline after a label's colon.
### nl_after_label_colon = false # false/true
# The number of newlines after '}' or ';' of a struct/enum/union definition
nl_after_struct = 0 # number
# The number of newlines after '}' or ';' of a class definition
nl_after_class = 0 # number
# The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label.
# Will not change the newline count if after a brace open.
# 0 = No change.
nl_before_access_spec = 0 # number
# The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label.
# 0 = No change.
nl_after_access_spec = 0 # number
# The number of newlines between a function def and the function comment.
# 0 = No change.
nl_comment_func_def = 0 # number
# The number of newlines after a try-catch-finally block that isn't followed by a brace close.
# 0 = No change.
nl_after_try_catch_finally = 0 # number
# The number of newlines before and after a property, indexer or event decl.
# 0 = No change.
nl_around_cs_property = 0 # number
# The number of newlines between the get/set/add/remove handlers in C#.
# 0 = No change.
nl_between_get_set = 0 # number
# Add or remove newline between C# property and the '{'
nl_property_brace = ignore # ignore/add/remove/force
# 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
# How aggressively to remove extra newlines not in preproc.
# 0: No change
# 1: Remove most newlines not handled by other config
# 2: Remove all newlines and reformat completely by config
nl_remove_extra_newlines = 0 # number
# Whether to put a blank line before 'return' statements, unless after an open brace.
nl_before_return = false # false/true
# Whether to put a blank line after 'return' statements, unless followed by a close brace.
nl_after_return = false # false/true
# Whether to put a newline after a Java annotation statement.
# Only affects annotations that are after a newline.
nl_after_annotation = ignore # ignore/add/remove/force
# Controls the newline between two annotations.
nl_between_annotation = ignore # ignore/add/remove/force
#
# Preprocessor options
#
# Control indent of preprocessors inside #if blocks at brace level 0 (file-level)
pp_indent = ignore # ignore/add/remove/force
# Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false)
pp_indent_at_level = false # false/true
# Specifies the number of columns to indent preprocessors per level at brace level 0 (file-level).
# If pp_indent_at_level=false, specifies the number of columns to indent preprocessors per level at brace level > 0 (function-level).
# Default=1.
pp_indent_count = 1 # number
# Add or remove space after # based on pp_level of #if blocks
pp_space = ignore # ignore/add/remove/force
# Sets the number of spaces added with pp_space
pp_space_count = 0 # number
# The indent for #region and #endregion in C# and '#pragma region' in C/C++
pp_indent_region = 0 # number
# Whether to indent the code between #region and #endregion
pp_region_indent_code = false # false/true
# If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level.
# 0: indent preprocessors using output_tab_size.
# >0: column at which all preprocessors will be indented.
pp_indent_if = 0 # number
# Control whether to indent the code between #if, #else and #endif.
pp_if_indent_code = false # false/true
# Whether to indent '#define' at the brace level (true) or from column 1 (false)
pp_define_at_level = false # false/true
# You can force a token to be a type with the 'type' option.
# Example:
# type myfoo1 myfoo2
#
# You can create custom macro-based indentation using macro-open,
# macro-else and macro-close.
# Example:
# macro-open BEGIN_TEMPLATE_MESSAGE_MAP
# macro-open BEGIN_MESSAGE_MAP
# macro-close END_MESSAGE_MAP
#
# You can assign any keyword to any type with the set option.
# set func_call_user _ N_
#
# The full syntax description of all custom definition config entries
# is shown below:
#
# define custom tokens as:
# - embed whitespace in token using '' escape character, or
# put token in quotes
# - these: ' " and ` are recognized as quote delimiters
#
# type token1 token2 token3 ...
# ^ optionally specify multiple tokens on a single line
# define def_token output_token
# ^ output_token is optional, then NULL is assumed
# macro-open token
# macro-close token
# macro-else token
# set id token1 token2 ...
# ^ optionally specify multiple tokens on a single line
# ^ id is one of the names in token_enum.h sans the CT_ prefix,
# e.g. PP_PRAGMA
#
# all tokens are separated by any mix of ',' commas, '=' equal signs
# and whitespace (space, tab)
#
# You can add support for other file extensions using the 'file_ext' command.
# The first arg is the language name used with the '-l' option.
# The remaining args are file extensions, matched with 'endswith'.
# file_ext CPP .ch .cxx .cpp.in
#