]> git.notmuchmail.org Git - notmuch/blob - devel/uncrustify.cfg
uncrustify.cfg: label indent, some known types, not, # and ##
[notmuch] / devel / uncrustify.cfg
1 #
2 # uncrustify config file for the linux kernel
3 #
4 # $Id: linux-indent.cfg 488 2006-09-09 12:44:38Z bengardner $
5 # Taken from the uncrustify distribution under license (GPL2+)
6 #
7 # sample usage:
8 #        uncrustify --replace -c uncrustify.cfg foo.c
9 #
10 #
11
12 indent_with_tabs        = 2             # 1=indent to level only, 2=indent with tabs
13 align_with_tabs         = TRUE          # use tabs to align
14 align_on_tabstop        = TRUE          # align on tabstops
15 input_tab_size          = 8             # original tab size
16 output_tab_size         = 8             # new tab size
17 indent_columns          = 4
18
19 indent_label            = -2            # pos: absolute col, neg: relative column
20
21 #
22 # inter-symbol newlines
23 #
24
25 nl_enum_brace           = remove        # "enum {" vs "enum \n {"
26 nl_union_brace          = remove        # "union {" vs "union \n {"
27 nl_struct_brace         = remove        # "struct {" vs "struct \n {"
28 nl_do_brace             = remove        # "do {" vs "do \n {"
29 nl_if_brace             = remove        # "if () {" vs "if () \n {"
30 nl_for_brace            = remove        # "for () {" vs "for () \n {"
31 nl_else_brace           = remove        # "else {" vs "else \n {"
32 nl_while_brace          = remove        # "while () {" vs "while () \n {"
33 nl_switch_brace         = remove        # "switch () {" vs "switch () \n {"
34 nl_brace_while          = remove        # "} while" vs "} \n while" - cuddle while
35 nl_brace_else           = remove        # "} else" vs "} \n else" - cuddle else
36 nl_func_var_def_blk     = 1
37 nl_fcall_brace          = remove        # "list_for_each() {" vs "list_for_each()\n{"
38 nl_fdef_brace           = force         # "int foo() {" vs "int foo()\n{"
39 # nl_after_return               = TRUE;
40 # nl_before_case        = 1
41
42 # Add or remove newline between return type and function name in definition
43 nl_func_type_name       = force
44 nl_enum_leave_one_liners = True
45 nl_enum_brace = Remove
46 nl_after_struct = 0
47 #
48 # Source code modifications
49 #
50
51 # mod_paren_on_return   = remove        # "return 1;" vs "return (1);"
52 # mod_full_brace_if     = remove        # "if (a) a--;" vs "if (a) { a--; }"
53 # mod_full_brace_for    = remove        # "for () a--;" vs "for () { a--; }"
54 # mod_full_brace_do     = remove        # "do a--; while ();" vs "do { a--; } while ();"
55 # mod_full_brace_while  = remove        # "while (a) a--;" vs "while (a) { a--; }"
56
57 #
58 # Extra types used in notmuch source.
59 # (add more on demand)
60
61 type GMimeObject mime_node_t
62
63 #
64 # inter-character spacing options
65 #
66
67 sp_before_ptr_star      = force
68 sp_between_ptr_star     = remove
69 sp_after_ptr_star       = remove
70 sp_not                  = force
71 sp_pp_concat            = ignore        # XXX 'remove' drops leading space also
72 sp_pp_stringify         = remove
73
74 # sp _return_paren      = force         # "return (1);" vs "return(1);"
75 sp_sizeof_paren         = force         # "sizeof (int)" vs "sizeof(int)"
76 sp_before_sparen        = force         # "if (" vs "if("
77 sp_after_sparen         = force         # "if () {" vs "if (){"
78 sp_sparen_brace         = force
79 sp_after_cast           = force         # "(int) a" vs "(int)a"
80 sp_inside_braces        = add           # "{ 1 }" vs "{1}"
81 sp_inside_braces_struct = add           # "{ 1 }" vs "{1}"
82 sp_inside_braces_enum   = add           # "{ 1 }" vs "{1}"
83 sp_assign               = force
84 sp_arith                = force
85 sp_bool                 = add
86 sp_compare              = add
87 sp_assign               = add
88 sp_after_comma          = add
89 sp_func_def_paren       = force         # "int foo (){" vs "int foo(){"
90 sp_func_call_paren      = force         # "foo (" vs "foo("
91 sp_func_proto_paren     = force         # "int foo ();" vs "int foo();"
92 sp_brace_else           = force         # "} else" vs "}else"
93 sp_else_brace           = force         # "else {" vs "else{"
94 #
95 # Aligning stuff
96 #
97
98 align_enum_equ_span     = 4             # '=' in enum definition
99 # align_nl_cont         = TRUE
100 # align_var_def_span    = 2
101 # align_var_def_inline  = TRUE
102 # align_var_def_star    = FALSE
103 # align_var_def_colon   = TRUE
104 # align_assign_span     = 1
105 align_struct_init_span  = 0             # align stuff in a structure init '= { }'
106 align_right_cmt_span    = 8             # align comments span this much in func
107 # align_pp_define_span  = 8;
108 # align_pp_define_gap   = 4;
109
110 # cmt_star_cont         = FALSE
111
112 # indent_brace          = 0