blob: f61b1176037fa2afb1f4d33cee142570984c3725 (
plain)
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
|
Quick documentation (probably out of date - see options.h)
There are five type of arguments:
- boolean (true/false)
- numeric
- ignore/add/remove/force
- LF/CRLF/CR/AUTO
- ignore/lead/trail
"Ignore" means do not change it.
"Add" in the context of spaces means make sure there is at least 1.
"Add" elsewhere means make sure one is present.
"Remove" mean remove the space/brace/newline/etc.
"Force" in the context of spaces means ensure that there is exactly 1.
"Force" in other contexts means the same as "add".
Configuration items may reference previously defined configuration items.
Numeric items may be prefixed with a '-' to invert the number.
Boolean items may be prefixed with a '-' or '~' to invert the value.
For example, the following is valid:
output_tab_size = 4
indent_columns = output_tab_size
All items default to false/0/ignore except:
- newlines = auto
- input_tab_size = 8
- output_tab_size = 8
- indent_columns = 8
- indent_with_tabs = 1
- indent_label = 1
- indent_access_spec = 1
- sp_before_comma = remove
- string_escape_char = 92 # '\'
Refer to set_option_defaults()
Terminology:
There are three types of parenthesis: sparen, fparen, paren.
sparen are found with if/for/switch/while statements.
fparen are found with function prototypes, calls and implementations.
paren are everything else, such as those found with arithmetic ops.
A 'span' is the maximum number of lines that a aligning feature will be
considered. This is done to limit the scope of the aligning.
So, if a span is set to 3 and more than 3 lines do not contain the item
that is to be aligned, then the aligning set is closed.
A 'gap' is the minimum spacing for aligned items.
So, if it is set to 3 for typedefs, then there are a minimum of three
spaces between the type and the typedef name.
A 'threshold' is the maximum number of columns that a aligning feature
will be considered. This is done to limit the scope of the aligning.
This prevents really longs lines from being aligned with short lines.
A list of all the options with documentation can be acquired by running
uncrustify with the following options:
$ uncrustify --show-config
To get a valid configuration file with all defaults, run this:
$ uncrustify -c /dev/null --update-config-with-doc
|