-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuncrustify.cfg
145 lines (133 loc) · 5.03 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
#
# Uncrustify config for phosh and related projects
#
# A span is the number of lines considered
# A threshold is the maximum number of columns an item is moved
# Indent by two spaces
indent_columns = 2
# No tabs
indent_with_tabs = 0
# Line length
code_width = 100
# Whether to remove superfluous semicolons
mod_remove_extra_semicolon = true
# indent goto by 1 (or -1 brace level)
indent_label = -1
# don't indent case after switch
indent_switch_case = 0
#
# Keywords and operators
#
# Add between 'do' and '{'.
sp_do_brace_open = add
# Add space between '}' and 'while'.
sp_brace_close_while = add
# Add 'while' and '('.
sp_while_paren_open = add
# Add or remove space around boolean operators '&&' and '||'.
sp_bool = add
# Ternary operator
sp_cond_ternary_short = remove
# Remove newline between 'struct and '{'.
nl_struct_brace = remove
# Remove newline between 'if' and '{'.
nl_if_brace = remove
# Remove newline between '}' and 'else'.
nl_brace_else = remove
# Remove newline between 'else' and '{'.
nl_else_brace = remove
# Remove newline between 'else' and 'if'.
nl_else_if = remove
# Add or remove newline between 'for' and '{'.
nl_for_brace = remove
# Add or remove newline between 'while' and '{'.
nl_while_brace = remove
# Treat iterators as for loops:
set FOR wl_list_for_each wl_list_for_each_reverse wl_list_for_each_safe
# Remove braces on single line if/for/while statements
mod_full_brace_if = remove
mod_full_brace_for = remove
mod_full_brace_while = remove
# If any must be braced, they are all braced. If all can be unbraced, then the braces are removed.
mod_full_brace_if_chain = 1
# Remove braces around case (when there are no variables declarations)
mod_case_brace = remove
# Don't remove branches if the statement has more than one line
mod_full_brace_nl = 2
#
# Function declarations, definitions and calls
#
# Add space between function name and '(' on function declaration.
sp_func_proto_paren = add
# Add or remove space between function name and '()' on function declaration
# without parameters.
sp_func_proto_paren_empty = add
# Add space between function name and '(' on function definition.
sp_func_def_paren = add
# Add or remove space between function name and '(' on function calls.
sp_func_call_paren = add
# Specialcase i18n macros
set func_call_user _ N_ C_
sp_func_call_user_paren = remove
# Whether to force indentation of function definitions to start in column 1.
indent_func_def_force_col1 = true
# Add newline between return type and function name in a function definition.
nl_func_type_name = add
# Add newline between function signature and '{'.
nl_fdef_brace = add
# Whether to align variable definitions in prototypes and functions.
align_func_params = true
# The span for aligning function prototypes.
align_func_proto_span = 8
# Add space between 'decltype(...)' and word.
sp_after_decltype = add
# Add or remove space after a pointer star '*', if followed by a function
# prototype or function definition.
sp_after_ptr_star_func = remove
# Add or remove newline between a function call's ')' and '{', as in
# 'list_for_each(item, &list) { }'.
nl_fcall_brace = add
#
# Typedefs
#
# Add space between '}' and the name of a typedef on the same line.
sp_brace_typedef = add
#
# Comments
#
# Add space after the opening of a C++ comment, i.e. '// A' vs. '//A'.
sp_cmt_cpp_start = add
#
# Preprocessor
#
# Add or remove space between #else or #endif and a trailing comment.
sp_endif_cmt = add
# Newlines at the start and end of the file.
nl_start_of_file = remove
nl_end_of_file = add
nl_end_of_file_min = 1
#
# Variable definitions
#
# How to align the '*' in variable definitions.
#
# 0: Part of the type 'void * foo;' (default)
# 1: Part of the variable 'void *foo;'
# 2: Dangling 'void *foo;'
# Dangling: the '*' will not be taken into account when aligning.
align_var_def_star_style = 2
# Same for typedefs
align_typedef_star_style = 2
# The gap for aligning struct/union member definitions.
align_var_struct_gap = 1
# The span for aligning struct/union member definitions.
align_var_struct_span = 4
# The threshold for aligning struct/union member definitions.
align_var_struct_thresh = 8
# Remove space between pointer stars '*'.
sp_between_ptr_star = remove
# Add space before '(' of control statements ('if', 'for', 'switch', 'while', etc.)
sp_before_sparen = add
# Add spaces around assignments and arithmethic operators
sp_assign = add
sp_arith = add