-
Notifications
You must be signed in to change notification settings - Fork 8
/
.uncrustify.cfg
147 lines (117 loc) · 4.86 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
# Ambrevar C-style
# Inspired by K&R and Go, with function opening brace on the same line.
# We enforce some sane properties, such as UTF-8 and LF newlines.
# No alignment, tab-indented.
################################################################################
# General options
newlines = lf
utf8_bom = remove
utf8_byte = true
utf8_force = true
################################################################################
# Indenting
# 1=indent to level only, 2=indent with tabs
indent_with_tabs = 2
input_tab_size = 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 = 0
# Whether to indent comments found in first column
indent_col1_comment = true # false/true
# 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 # number
################################################################################
# Code modifying options (non-whitespace)
mod_paren_on_return = remove # "return 1;" -> "return (1);"
mod_full_brace_if = force # "if (a) a--;" -> "if (a) { a--; }"
mod_full_brace_for = force
mod_full_brace_do = force
mod_full_brace_while = force
################################################################################
# Newline adding and removing options
nl_enum_brace = remove # "enum \n {" -> "enum {"
nl_union_brace = remove
nl_struct_brace = remove
nl_do_brace = remove
nl_if_brace = remove
nl_for_brace = remove
nl_else_brace = remove
nl_while_brace = remove
nl_switch_brace = remove
nl_fcall_brace = remove
nl_fdef_brace = remove
nl_brace_while = remove
nl_brace_else = remove
# Whether to not put blanks after '#ifxx', '#elxx', or before '#endif'
# nl_squeeze_ifdef = true
# Add or remove newline between return type and function name in a function definition
nl_func_type_name = remove
# Whether to remove blank lines before/after '}'/'{' respectively.
eat_blanks_before_close_brace = true
eat_blanks_after_open_brace = true
# nl_after_return = true
# nl_func_var_def_blk = 1
# nl_before_case = 1
################################################################################
# Spacing options
sp_arith = force
sp_assign = force
sp_bool = force
sp_compare = force
sp_before_semi = remove
sp_before_square = remove
sp_before_squares = remove
sp_inside_square = remove
sp_after_comma = force
sp_after_cast = remove # "(int) a" -> "(int)a"
sp_after_sparen = force # "if (){" -> "if () {"
sp_before_sparen = force # "if (" -> "if("
sp_inside_paren = remove # "( 1 )" -> "(1)"
sp_paren_paren = remove # space between (( and ))
sp_inside_fparen = remove # "( 1 )" -> "(1)" - functions
sp_inside_sparen = remove # "( 1 )" -> "(1)" - if/for/etc
sp_sizeof_paren = force # "sizeof(int)" -> "sizeof (int)"
sp_inside_braces = remove # "{ 1 }" -> "{1}"
sp_inside_braces_struct = remove # "{ 1 }" -> "{1}"
sp_inside_braces_enum = remove # "{ 1 }" -> "{1}"
sp_func_def_paren = remove # "int foo () {" -> "int foo() {"
sp_func_proto_paren = remove # "int foo ();" -> "int foo();"
sp_func_call_paren = remove # "foo (" -> "foo("
sp_return_paren = remove # "return (1);" -> "return(1);"
sp_else_brace = force # "else{" -> "else {"
sp_brace_else = force # "}else" -> "} else"
# Add or remove space before pointer star '*'
sp_before_ptr_star = force # ignore/add/remove/force
# Add or remove space between pointer stars '*'
sp_between_ptr_star = remove # ignore/add/remove/force
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star = remove # ignore/add/remove/force
# Add or remove space between return type and function name
# A minimum of 1 is forced except for pointer return types.
sp_type_func = force
# Add or remove space between ')' and '(' of function
sp_fparen_brace = force
################################################################################
# Comment modifications
# Whether to change cpp-comments into c-comments
cmt_cpp_to_c = true
# Whether to put a star on subsequent comment lines
# cmt_star_cont = true
# If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars.
cmt_indent_multi = false
# Set the comment reflow mode (default: 0)
# 0: no reflowing (apart from the line wrapping due to cmt_width)
# 1: no touching at all
# 2: full reflow
# cmt_reflow_mode = 0
################################################################################
# Preprocessor options
# Add or remove space after # based on pp_level of #if blocks
pp_space = remove
# Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false)
pp_indent_at_level = true # false/true
# Whether to indent '#define' at the brace level (true) or from column 1 (false)
pp_define_at_level = true # false/true