-
Notifications
You must be signed in to change notification settings - Fork 3
/
uncrustify.cfg
292 lines (206 loc) · 8 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
#
# General options
#
# The size of tabs in the output (only used if align_with_tabs=true)
output_tab_size=4
#
# Code alignment (not left column spaces/tabs)
#
# The span for aligning on '=' in enums (0=don't align)
align_enum_equ_span=4
# Span for aligning parameters in an Obj-C message call on the ':' (0=don't align)
align_oc_msg_colon_span=0
# The span for aligning ObjC msg spec (0=don't align)
align_oc_msg_spec_span=0
# Whether to bump out to the next tab when aligning
align_on_tabstop=true
# The span for aligning on '#define' bodies (0=don't align)
align_pp_define_span=8
# If a trailing comment is more than this number of columns away from the text it follows,
# it will qualify for being aligned. This has to be > 0 to do anything.
align_right_cmt_gap=8
# The span for aligning comments that end lines (0=don't align)
align_right_cmt_span=8
# The span for aligning struct initializer values (0=don't align)
align_struct_init_span=4
# Whether to use tabs for aligning
align_with_tabs=true
#
# Comment modifications
#
# Whether to put a star on subsequent comment lines
cmt_star_cont=true
#
# Indenting
#
# 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=output_tab_size
# Align continued statements at the '='. Default=True
# If FALSE or the '=' is followed by a newline, the next line is indent one tab.
indent_align_assign=false
# The number of columns to indent per level.
# Usually 2, 3, 4, or 8.
indent_columns=output_tab_size
# How to indent goto labels
# >0 : absolute column where 1 is the leftmost column
# <=0 : subtract from brace indent
indent_label=2
# Spaces to indent 'case' from 'switch'
# Usually 0 or indent_columns.
indent_switch_case=indent_columns
# 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=2
#
# Code modifying options (non-whitespace)
#
# Add or remove braces on single-line 'do' statement
mod_full_brace_do=ignore
# Add or remove braces on single-line 'for' statement
mod_full_brace_for=add
# Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'.
mod_full_brace_if=ignore
# Don't remove braces around statements that span N newlines
mod_full_brace_nl=3
# Add or remove braces on single-line 'while' statement
mod_full_brace_while=remove
# Add or remove unnecessary paren on 'return' statement
mod_paren_on_return=ignore
#
# Newline adding and removing options
#
# Add or remove newline between '}' and 'else'
nl_brace_else=force
# Add or remove newline between '}' and 'while' of 'do' statement
nl_brace_while=remove
# Add or remove newline between 'do' and '{'
nl_do_brace=remove
# Add or remove newline between 'else' and '{'
nl_else_brace=remove
# Add or remove newline between 'enum' and '{'
nl_enum_brace=remove
# Add or remove newline between a function call's ')' and '{', as in:
# list_for_each(item, &list) { }
nl_fcall_brace=remove
# Add or remove newline between function signature and '{'
nl_fdef_brace=remove
# Add or remove newline between 'for' and '{'
nl_for_brace=remove
# The number of blank lines after a block of variable definitions at the top of a function body
# 0 = No change (default)
nl_func_var_def_blk=1
# Add or remove newline between 'if' and '{'
nl_if_brace=remove
# Add or remove newline between 'struct and '{'
nl_struct_brace=remove
# Add or remove newline between 'switch' and '{'
nl_switch_brace=remove
# Add or remove newline between 'union' and '{'
nl_union_brace=remove
# Add or remove newline between 'while' and '{'
nl_while_brace=remove
#
# Spacing options
#
# Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a'
sp_after_cast=remove
# Add or remove space after class ':'
sp_after_class_colon=force
# Add or remove space after ','
sp_after_comma=force
# Add or remove space between '@selector' and '('
# '@selector(msgName)' vs '@selector (msgName)'
# Also applies to @protocol() constructs
sp_after_oc_at_sel=remove
# Add or remove space after a block pointer caret
# '^int (int arg){...}' vs. '^ int (int arg){...}'
sp_after_oc_block_caret=remove
# Add or remove space after the colon in message specs
# '-(int) f:(int) x;' vs '-(int) f: (int) x;'
sp_after_oc_colon=remove
# Add or remove space after the colon in immutable dictionary expression
# 'NSDictionary *test = @{@"foo" :@"bar"};'
sp_after_oc_dict_colon=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=remove
# Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;'
sp_after_oc_scope=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
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star=remove
# Add or remove space after a pointer star '*', if followed by a func proto/def.
sp_after_ptr_star_func=force
# Add or remove space after the colon in message specs
# '[object setValue:1];' vs '[object setValue: 1];'
sp_after_send_oc_colon=remove
# Add or remove space after ')' of 'if', 'for', 'switch', and 'while'
sp_after_sparen=force
# Add or remove space around arithmetic operator '+', '-', '/', '*', etc
sp_arith=ignore
# Add or remove space around assignment operator '=', '+=', etc
sp_assign=force
# Add or remove space before case ':'. Default=Remove
sp_before_case_colon=remove
# Add or remove space before class ':'
sp_before_class_colon=force
# Add or remove space before a block pointer caret
# '^int (int arg){...}' vs. ' ^int (int arg){...}'
sp_before_oc_block_caret=ignore
# Add or remove space before the colon in message specs
# '-(int) f: (int) x;' vs '-(int) f : (int) x;'
sp_before_oc_colon=remove
# Add or remove space before the colon in immutable dictionary expression
# 'NSDictionary *test = @{@"foo" :@"bar"};'
sp_before_oc_dict_colon=remove
# Add or remove space before pointer star '*'
sp_before_ptr_star=force
# Add or remove space before a pointer star '*', if followed by a func proto/def.
sp_before_ptr_star_func=force
# Add or remove space before the colon in message specs
# '[object setValue:1];' vs '[object setValue :1];'
sp_before_send_oc_colon=remove
# Add or remove space before '(' of 'if', 'for', 'switch', and 'while'
sp_before_sparen=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
# Add or remove space between pointer stars '*'
sp_between_ptr_star=remove
# Add or remove space around boolean operators '&&' and '||'
sp_bool=force
# Add or remove space between '}' and 'else' if on the same line
sp_brace_else=force
# Control the space after the opening of a C++ comment '// A' vs '//A'
sp_cmt_cpp_start=force
# Add or remove space around compare operator '<', '>', '==', etc
sp_compare=force
# Add or remove space around the ':' in 'b ? t : f'
sp_cond_colon=force
# Add or remove space around the '?' in 'b ? t : f'
sp_cond_question=force
# Add or remove space between 'else' and '{' if on the same line
sp_else_brace=force
# Add or remove space between function name and '(' on function calls
sp_func_call_paren=remove
# Add or remove space between function name and '(' on function definition
sp_func_def_paren=remove
# Add or remove space between function name and '(' on function declaration
sp_func_proto_paren=remove
# Add or remove space inside '{' and '}'
sp_inside_braces=add
# Add or remove space inside enum '{' and '}'
sp_inside_braces_enum=add
# Add or remove space inside struct/union '{' and '}'
sp_inside_braces_struct=add
# Add or remove space inside function '(' and ')'
sp_inside_fparen=remove
# Add or remove space between ')' and '{'
sp_paren_brace=force
# Add or remove space between 'sizeof' and '('
sp_sizeof_paren=remove