-
Notifications
You must be signed in to change notification settings - Fork 25
/
uncrustify.cfg
402 lines (352 loc) · 9.42 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
# General configuration
input_tab_size = 4
output_tab_size = 4
string_replace_tab_chars = false
disable_processing_nl_cont = true # Avoid mangling multi-line macros, like static init
utf8_bom = remove
# disable_processing_cmt = " *INDENT-OFF*"
# enable_processing_cmt = " *INDENT-ON*"
# processing_cmt_as_regex = false
# Enum spacing
sp_enum_brace = force
sp_inside_braces_enum = remove
sp_enum_paren = force
sp_enum_assign = force
# Preprocessor spacing
sp_pp_concat = force
sp_pp_stringify = ignore
sp_before_pp_stringify = force
# Operator spacing
sp_arith = force
sp_arith_additive = force
sp_assign = force
sp_bool = force
sp_compare = force
sp_inside_paren = remove
sp_paren_paren = remove
sp_cparen_oparen = force
# sp_balance_nested_parens = false
sp_paren_brace = force
# Pointer spacing
sp_before_ptr_star = force
sp_before_unnamed_ptr_star = remove
sp_before_qualifier_ptr_star = force
sp_qualifier_unnamed_ptr_star = remove
sp_between_ptr_star = remove
sp_after_ptr_star = remove
sp_after_ptr_star_qualifier = remove
sp_after_ptr_star_func = force
sp_ptr_star_func_var = remove
sp_ptr_star_func_type = remove
sp_ptr_star_paren = force
sp_before_ptr_star_func = remove
sp_qualifier_ptr_star_func = remove
# Variable spacing
sp_after_type = force
# Control statement spacing
sp_before_sparen = force
sp_inside_sparen = remove
sp_inside_for = remove
sp_sparen_paren = remove
# sp_after_sparen = force
sp_sparen_brace = force
sp_do_brace_open = force
sp_brace_close_while = force
sp_while_paren_open = force
# Semicolon spacing
# sp_special_semi = remove
sp_before_semi = remove
sp_before_semi_for = remove
sp_before_semi_for_empty = remove
sp_between_semi_for_empty = remove
sp_after_semi = remove
sp_after_semi_for = force
sp_after_semi_for_empty = remove
# Array spacing
sp_before_square = remove
sp_before_vardef_square = remove
sp_before_squares = remove
sp_inside_square = remove
sp_inside_square_empty = remove
# Comma spacing
sp_after_comma = force
sp_before_comma = remove
sp_paren_comma = force
# Misc spacing
sp_paren_qualifier = force
sp_after_cast = force
sp_inside_paren_cast = remove
sp_sizeof_paren = force
sp_attribute_paren = remove
sp_defined_paren = force
sp_endif_cmt = force
# force_tab_after_define = true
# Braces spacing
sp_brace_brace = remove
sp_inside_braces_struct = remove
sp_inside_type_brace_init_lst = remove
sp_inside_braces = remove
sp_inside_braces_empty = remove
sp_type_brace_init_lst = force
sp_else_brace = force
sp_brace_else = force
sp_brace_typedef = force
# Function spacing
sp_type_func = force
sp_func_proto_paren = force
sp_func_proto_paren_empty = force
sp_func_type_paren = force
sp_func_def_paren = force
sp_func_def_paren_empty = force
sp_inside_fparens = remove
sp_inside_fparen = remove
sp_inside_tparen = remove
sp_after_tparen_close = force
sp_square_fparen = force
sp_fparen_brace = force
sp_fparen_brace_initializer = force
sp_func_call_paren = force
sp_func_call_paren_empty = force
sp_return = force
sp_return_paren = force
sp_return_brace = force
# Macro spacing
sp_macro = add
sp_macro_func = add
# Unary spacing
sp_not = remove
sp_not_not = remove
sp_inv = remove
sp_addr = remove
sp_member = remove
sp_deref = remove
sp_sign = remove
sp_incdec = remove
sp_before_nl_cont = ignore
# Ternary spacing
sp_cond_colon = force
sp_cond_question = force
# Switch spacing
sp_case_label = force
sp_before_case_colon = remove
# Comment spacing
sp_before_tr_cmt = add
sp_num_before_tr_cmt = 4
sp_before_emb_cmt = force
sp_num_before_emb_cmt = 1
sp_after_emb_cmt = force
sp_num_after_emb_cmt = 1
# Bitfield spacing
sp_before_bit_colon = remove
sp_after_bit_colon = remove
# Indent configuration
indent_columns = 4
indent_ignore_first_continue = false
indent_continue = 4
indent_single_newlines = false
indent_param = 4
indent_with_tabs = 2
indent_cmt_with_tabs = true
indent_align_string = false
indent_brace = 0
indent_braces = false
indent_brace_parent = false
indent_paren_open_brace = false
indent_else_if = false
indent_var_def_blk = 0
indent_var_def_cont = true
indent_shift = 1
align_left_shift = false
# Function parameter indenting
indent_func_call_param = true
indent_func_def_param = true
indent_func_proto_param = true
indent_func_class_param = true
indent_macro_brace = true
indent_member_single = true
# When opening a paren for a control statement (if, for, while, etc), increase
# the indent level by this value. Negative values decrease the indent level.
indent_sparen_extra = 0
indent_relative_single_line_comments = true
# Switch indenting
indent_switch_case = 4
indent_switch_body = 4
indent_switch_break_with_case = false
# indent_switch_pp = false
indent_comment_align_thresh = 4
indent_paren_close = 2
# indent_compound_literal_return = true
indent_align_assign = false
indent_align_paren = false
indent_ternary_operator = 0
indent_inside_ternary_operator = true
# Newline handling
nl_end_of_file = force
nl_end_of_file_min = 1
# Brace newlines
nl_assign_brace = remove
nl_fcall_brace = remove
nl_enum_brace = remove
nl_struct_brace = remove
nl_union_brace = remove
nl_if_brace = remove
nl_brace_else = force
nl_elseif_brace = remove
nl_else_brace = remove
nl_else_if = remove
nl_before_if_closing_paren = 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 = false
nl_case_colon_brace = remove
nl_fdef_brace = force
nl_type_brace_init_lst = remove
nl_type_brace_init_lst_open = force
nl_type_brace_init_lst_close = ignore
nl_before_brace_open = false
nl_after_brace_open = true
nl_assign_leave_one_liners = true
nl_before_case = true
nl_enum_own_lines = force
# nl_after_semicolon = true
nl_define_macro = false
nl_after_label_colon = true
# Function newlines
nl_func_type_name = remove
nl_func_proto_type_name = remove
nl_func_paren = remove
nl_func_paren_empty = remove
nl_func_def_paren = remove
nl_func_def_paren_empty = remove
nl_func_call_paren = remove
nl_func_call_paren_empty = remove
nl_func_decl_start = ignore
nl_func_def_start = ignore
nl_func_decl_start_single = ignore
nl_func_def_start_single = ignore
nl_func_decl_start_multi_line = false
nl_func_def_start_multi_line = false
nl_func_decl_args = remove
nl_func_def_args = remove
nl_func_call_args = remove
nl_func_decl_args_multi_line = false
nl_func_def_args_multi_line = false
nl_func_decl_end = remove
nl_func_def_end = remove
nl_func_decl_end_single = remove
nl_func_def_end_single = remove
nl_func_decl_end_multi_line = false
nl_func_def_end_multi_line = false
nl_func_decl_empty = remove
nl_func_def_empty = remove
nl_func_call_empty = remove
nl_func_call_start = remove
nl_func_call_end = remove
nl_func_call_start_multi_line = false
nl_func_call_args_multi_line = false
nl_func_call_end_multi_line = false
nl_return_expr = remove
nl_before_return = true
nl_after_return = false
nl_before_member = remove
nl_split_if_one_liner = true
nl_split_for_one_liner = true
nl_split_while_one_liner = true
# Blank lines
nl_max = 4
nl_max_blank_in_func = 2
nl_inside_empty_func = 2
# Disable these for now as they don't work well in the presence of #if/#endif
# nl_after_func_proto_group = 2
# nl_after_func_body = 2
nl_after_func_body_one_liner = 2
nl_var_def_blk_end_func_top = 2
nl_var_def_blk_end = 2
nl_after_struct = 2
eat_blanks_after_open_brace = true
eat_blanks_before_close_brace = true
# nl_remove_extra_newlines = 0
nl_before_whole_file_ifdef = 2
nl_after_whole_file_ifdef = 1
nl_before_whole_file_endif = 3
nl_after_whole_file_endif = 2
# Positioning options
pos_arith = trail
pos_assign = trail
pos_bool = trail
pos_compare = trail
pos_conditional = trail
pos_comma = trail
pos_enum_comma = trail_force
pos_shift = trail
# Line splitting options
code_width = 100
ls_for_split_full = false
ls_func_split_full = false
ls_code_width = false
# Code alignment options (not left column spaces/tabs)
align_keep_tabs = true
align_with_tabs = true
align_on_tabstop = true
align_func_params = false
align_same_func_call_params = false
align_var_def_span = 0
align_var_def_colon = false
align_var_def_inline = false
align_assign_span = 0
align_assign_func_proto_span = 0
align_enum_equ_span = 0
align_var_struct_span = 0
align_struct_init_span = 0
align_typedef_span = 0
align_func_proto_span = 0
align_right_cmt_span = 4
align_right_cmt_gap = 1
align_right_cmt_mix = false
align_right_cmt_same_level = false
align_right_cmt_at_col = 4
# Comment modification options
cmt_width = 0
cmt_reflow_mode = 0
cmt_indent_multi = false
# cmt_c_nl_start = false
# cmt_c_nl_end = false
# cmt_star_cont = true
# cmt_sp_before_star_cont = 1
# cmt_sp_after_star_cont = 1
# cmt_multi_check_last = true
# cmt_multi_first_len_minimum = 4
# Code modifying options (non-whitespace)
mod_full_brace_do = force
mod_full_brace_for = force
mod_full_brace_if = force
mod_full_brace_while = force
mod_full_paren_if_bool = true
mod_full_paren_assign_bool = true
mod_full_paren_return_bool = true
mod_remove_extra_semicolon = true
mod_remove_duplicate_include = true
mod_sort_include = true
mod_sort_incl_import_prioritize_angle_over_quotes = true
include_category_0 = '^"[^/]+"$'
include_category_1 = '^".*"$'
include_category_2 = '^"testing/.*"$'
mod_move_case_break = true
mod_move_case_return = true
mod_case_brace = remove
mod_remove_empty_return = true
mod_enum_last_comma = force
# Preprocessor options
pp_indent_with_tabs = 2
pp_indent = remove
pp_indent_at_level = false
pp_indent_at_level0 = false
pp_if_indent_code = false
pp_indent_in_guard = false
pp_define_at_level = false
pp_include_at_level = false
pp_ignore_define_body = true
pp_multiline_define_body_indent = 4