]> git.notmuchmail.org Git - notmuch/blob - devel/uncrustify.cfg
6a8769c63902e76835d27c5d32a0fd7a4e32595c
[notmuch] / devel / uncrustify.cfg
1 #
2 # Uncrustify config file for notmuch.
3 # Based on uncrustify config file for the linux kernel
4 #
5 # $Id: linux-indent.cfg 488 2006-09-09 12:44:38Z bengardner $
6 # Taken from the uncrustify distribution under license (GPL2+)
7 #
8 # Sample usage:
9 #        uncrustify --replace -c uncrustify.cfg foo.c
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 indent_cmt_with_tabs    = false         # true would align to tabstop always...
22
23 #
24 # inter-symbol newlines
25 #
26
27 nl_enum_brace           = remove        # "enum {" vs "enum \n {"
28 nl_union_brace          = remove        # "union {" vs "union \n {"
29 nl_struct_brace         = remove        # "struct {" vs "struct \n {"
30 nl_do_brace             = remove        # "do {" vs "do \n {"
31 nl_if_brace             = remove        # "if () {" vs "if () \n {"
32 nl_for_brace            = remove        # "for () {" vs "for () \n {"
33 nl_else_brace           = remove        # "else {" vs "else \n {"
34 nl_while_brace          = remove        # "while () {" vs "while () \n {"
35 nl_switch_brace         = remove        # "switch () {" vs "switch () \n {"
36 nl_brace_while          = remove        # "} while" vs "} \n while" - cuddle while
37 nl_brace_else           = remove        # "} else" vs "} \n else" - cuddle else
38 nl_func_var_def_blk     = 1
39 nl_fcall_brace          = remove        # "list_for_each() {" vs "list_for_each()\n{"
40 nl_fdef_brace           = force         # "int foo() {" vs "int foo()\n{"
41 # nl_after_return               = TRUE;
42 # nl_before_case        = 1
43
44 # Add or remove newline between return type and function name in definition
45 nl_func_type_name       = force
46 nl_enum_leave_one_liners = True
47 nl_enum_brace = Remove
48 nl_after_struct = 0
49 #
50 # Source code modifications
51 #
52
53 # mod_paren_on_return   = remove        # "return 1;" vs "return (1);"
54 # mod_full_brace_if     = remove        # "if (a) a--;" vs "if (a) { a--; }"
55 # mod_full_brace_for    = remove        # "for () a--;" vs "for () { a--; }"
56 # mod_full_brace_do     = remove        # "do a--; while ();" vs "do { a--; } while ();"
57 # mod_full_brace_while  = remove        # "while (a) a--;" vs "while (a) { a--; }"
58
59
60 # In case some custom types aren't detected properly by uncrustify
61 # add those to this section below. For example there are cases where
62 # uncrustify doesn't know whether a 'token' is part of pointer type
63 # or left operand of a binary multiplication operation.
64
65 type FILE
66 type GMimeObject GMimeCryptoContext GMimeCipherContext
67 type mime_node_t notmuch_message_t notmuch_show_params_t
68 type sprinter_t
69
70 #
71 # inter-character spacing options
72 #
73
74 sp_before_ptr_star      = force
75 sp_between_ptr_star     = remove
76 sp_after_ptr_star       = remove
77 sp_not                  = force
78 sp_pp_concat            = ignore        # XXX 'remove' drops leading space also
79 sp_pp_stringify         = remove
80
81 # sp _return_paren      = force         # "return (1);" vs "return(1);"
82 sp_sizeof_paren         = force         # "sizeof (int)" vs "sizeof(int)"
83 sp_before_sparen        = force         # "if (" vs "if("
84 sp_after_sparen         = force         # "if () {" vs "if (){"
85 sp_sparen_brace         = force
86 sp_after_cast           = force         # "(int) a" vs "(int)a"
87 sp_inside_braces        = add           # "{ 1 }" vs "{1}"
88 sp_inside_braces_struct = add           # "{ 1 }" vs "{1}"
89 sp_inside_braces_enum   = add           # "{ 1 }" vs "{1}"
90 sp_assign               = force
91 sp_arith                = force
92 sp_bool                 = add
93 sp_compare              = add
94 sp_assign               = add
95 sp_after_comma          = add
96 sp_func_def_paren       = force         # "int foo (){" vs "int foo(){"
97 sp_func_call_paren      = force         # "foo (" vs "foo("
98 sp_func_proto_paren     = force         # "int foo ();" vs "int foo();"
99 sp_brace_else           = force         # "} else" vs "}else"
100 sp_else_brace           = force         # "else {" vs "else{"
101 #
102 # Aligning stuff
103 #
104
105 align_enum_equ_span     = 4             # '=' in enum definition
106 # align_nl_cont         = TRUE
107 # align_var_def_span    = 2
108 # align_var_def_inline  = TRUE
109 # align_var_def_star    = FALSE
110 # align_var_def_colon   = TRUE
111 # align_assign_span     = 1
112 align_struct_init_span  = 0             # align stuff in a structure init '= { }'
113 align_right_cmt_span    = 8             # align comments span this much in func
114 # align_pp_define_span  = 8;
115 # align_pp_define_gap   = 4;
116
117 cmt_star_cont           = true
118
119 # indent_brace          = 0