-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuncrustify.conf
321 lines (250 loc) · 10.8 KB
/
uncrustify.conf
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
# Uncrustify-0.72.0_f
#
# General options
#
# The type of line endings.
#
# Default: auto
newlines = lf # lf/crlf/cr/auto
# Add or remove the UTF-8 BOM (recommend 'remove').
utf8_bom = remove # ignore/add/remove/force
#
# Spacing options
#
# Add or remove space around non-assignment symbolic operators ('+', '/', '%',
# '<<', and so forth).
sp_arith = force # ignore/add/remove/force
# Add or remove space before assignment operator '=', '+=', etc.
#
# Overrides sp_assign.
sp_before_assign = force # ignore/add/remove/force
# Add or remove space after assignment operator '=', '+=', etc.
#
# Overrides sp_assign.
sp_after_assign = force # ignore/add/remove/force
# Add or remove space around boolean operators '&&' and '||'.
sp_bool = force # ignore/add/remove/force
# Add or remove space around compare operator '<', '>', '==', etc.
sp_compare = force # ignore/add/remove/force
# Add or remove space inside '(' and ')'.
sp_inside_paren = remove # ignore/add/remove/force
# Add or remove space between nested parentheses, i.e. '((' vs. ') )'.
sp_paren_paren = remove # ignore/add/remove/force
# Add or remove space before '(' of control statements ('if', 'for', 'switch',
# 'while', etc.).
sp_before_sparen = force # ignore/add/remove/force
# Add or remove space inside '(' and ')' of control statements.
sp_inside_sparen = remove # ignore/add/remove/force
# Add or remove space after ')' of control statements.
sp_after_sparen = force # ignore/add/remove/force
# Add or remove space between ')' and '{' of of control statements.
sp_sparen_brace = force # ignore/add/remove/force
# Add or remove space before ';' in non-empty 'for' statements.
sp_before_semi_for = remove # ignore/add/remove/force
# Add or remove space after ';' in non-empty 'for' statements.
#
# Default: force
sp_after_semi_for = force # ignore/add/remove/force
# Add or remove space before '[' (except '[]').
sp_before_square = remove # ignore/add/remove/force
# Add or remove space inside a non-empty '[' and ']'.
sp_inside_square = remove # ignore/add/remove/force
# Add or remove space after ',', i.e. 'a,b' vs. 'a, b'.
sp_after_comma = force # ignore/add/remove/force
# Add or remove spaces inside cast parentheses.
sp_inside_paren_cast = remove # ignore/add/remove/force
# Add or remove space between the type and open parenthesis in a C++ cast,
# i.e. 'int(exp)' vs. 'int (exp)'.
sp_cpp_cast_paren = remove # ignore/add/remove/force
# Add or remove space between ')' and '{' of function.
sp_fparen_brace = add # ignore/add/remove/force
# Add or remove space between 'else' and '{' if on the same line.
sp_else_brace = force # ignore/add/remove/force
# Add or remove space between '}' and 'else' if on the same line.
sp_brace_else = force # ignore/add/remove/force
# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'.
#
# Default: remove
sp_sign = remove # ignore/add/remove/force
# Add or remove space between '++' and '--' the word to which it is being
# applied, as in '(--x)' or 'y++;'.
#
# Default: remove
sp_incdec = remove # ignore/add/remove/force
# Add or remove space after the opening of a C++ comment,
# i.e. '// A' vs. '//A'.
sp_cmt_cpp_start = add # ignore/add/remove/force
# Add or remove space before a trailing or embedded comment.
sp_before_tr_emb_cmt = force # ignore/add/remove/force
#
# Indenting options
#
# Whether to indent comments that are not at a brace level with tabs on a
# tabstop. Requires indent_with_tabs=2. If false, will use spaces.
indent_cmt_with_tabs = false # true/false
# Whether to indent continued function call parameters one indent level,
# rather than aligning parameters under the open parenthesis.
indent_func_call_param = false # true/false
# If an open parenthesis is followed by a newline, whether to indent the next
# line so that it lines up after the open parenthesis (not recommended).
indent_paren_nl = false # true/false
# How to indent a close parenthesis after a newline.
#
# 0: Indent to body level (default)
# 1: Align under the open parenthesis
# 2: Indent to the brace level
indent_paren_close = 2 # unsigned number
# Whether to indent the open parenthesis of a function definition,
# if the parenthesis is on its own line.
indent_paren_after_func_def = false # true/false
# Whether to indent the open parenthesis of a function declaration,
# if the parenthesis is on its own line.
indent_paren_after_func_decl = false # true/false
# Whether to indent the open parenthesis of a function call,
# if the parenthesis is on its own line.
indent_paren_after_func_call = false # true/false
# Whether to add further spaces after regular indent to reach next tabstop
# when indenting after virtual brace open and newline.
indent_vbrace_open_on_tabstop = false # true/false
#
# Newline adding and removing options
#
# Don't split one-line function definitions, as in 'int foo() { return 0; }'.
# might modify nl_func_type_name
nl_func_leave_one_liners = true # true/false
# 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
# Add or remove newline between 'for' and '{'.
nl_for_brace = remove # ignore/add/remove/force
# Force a newline in a define after the macro name for multi-line defines.
nl_multi_line_define = true # true/false
# Add or remove newline after each ',' in a function definition.
nl_func_def_args = remove # ignore/add/remove/force
# Add or remove newline after each ',' in a function call.
nl_func_call_args = ignore # ignore/add/remove/force
# Whether to add a newline after '(' in a function call,
# has preference over nl_func_call_start_multi_line.
nl_func_call_start = remove # ignore/add/remove/force
# Whether to add a newline before ')' in a function call.
nl_func_call_end = ignore # ignore/add/remove/force
# Whether to add a newline before ')' in a function call if '(' and ')' are in
# different lines.
nl_func_call_end_multi_line = true # true/false
# Add or remove newline between function signature and '{'.
nl_fdef_brace = remove # ignore/add/remove/force
# Add or remove blank line before 'if'.
nl_before_if = add # ignore/add/remove/force
# Add or remove blank line before 'for'.
nl_before_for = add # ignore/add/remove/force
# Add or remove blank line after 'for' statement.
nl_after_for = add # ignore/add/remove/force
# Whether to put a blank line before 'return' statements, unless after an open
# brace.
nl_before_return = true # true/false
# Whether to remove a newline in simple unbraced if statements, turning them
# into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'.
nl_create_if_one_liner = false # true/false
# Whether to remove a newline in simple unbraced for statements, turning them
# into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'.
nl_create_for_one_liner = false # true/false
#
# Blank line options
#
# The maximum number of consecutive newlines (3 = 2 blank lines).
nl_max = 2 # unsigned number
#
# Positioning options
#
# The position of the comma in wrapped expressions.
pos_comma = trail # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
#
# Line splitting options
#
#
# Comment modification options
#
#
# Code modifying options (non-whitespace)
#
# Add or remove braces on a single-line 'for' statement.
mod_full_brace_for = ignore # ignore/add/remove/force
# Overrides mod_full_brace_if.
mod_full_brace_if_chain = true # true/false
# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain.
# If true, mod_full_brace_if_chain will only remove braces from an 'if' that
# does not have an 'else if' or 'else'.
mod_full_brace_if_chain_only = false # true/false
# Whether to remove superfluous semicolons.
mod_remove_extra_semicolon = true # true/false
#
# Preprocessor options
#
#
# Sort includes options
#
#
# Use or Do not Use options
#
# Meaning of the settings:
# Ignore - do not do any changes
# Add - makes sure there is 1 or more space/brace/newline/etc
# Force - makes sure there is exactly 1 space/brace/newline/etc,
# behaves like Add in some contexts
# Remove - removes space/brace/newline/etc
#
#
# - Token(s) can be treated as specific type(s) with the 'set' option:
# `set tokenType tokenString [tokenString...]`
#
# Example:
# `set BOOL __AND__ __OR__`
#
# tokenTypes are defined in src/token_enum.h, use them without the
# 'CT_' prefix: 'CT_BOOL' => 'BOOL'
#
#
# - Token(s) can be treated as type(s) with the 'type' option.
# `type tokenString [tokenString...]`
#
# Example:
# `type int c_uint_8 Rectangle`
#
# This can also be achieved with `set TYPE int c_uint_8 Rectangle`
#
#
# To embed whitespace in tokenStrings use the '\' escape character, or quote
# the tokenStrings. These quotes are supported: "'`
#
#
# - Support for the auto detection of languages through the file ending can be
# added using the 'file_ext' command.
# `file_ext langType langString [langString..]`
#
# Example:
# `file_ext CPP .ch .cxx .cpp.in`
#
# langTypes are defined in uncrusify_types.h in the lang_flag_e enum, use
# them without the 'LANG_' prefix: 'LANG_CPP' => 'CPP'
#
#
# - Custom macro-based indentation can be set up using 'macro-open',
# 'macro-else' and 'macro-close'.
# `(macro-open | macro-else | macro-close) tokenString`
#
# Example:
# `macro-open BEGIN_TEMPLATE_MESSAGE_MAP`
# `macro-open BEGIN_MESSAGE_MAP`
# `macro-close END_MESSAGE_MAP`
#
#
# option(s) with 'not default' value: Fair enough... I guess
#