Re: notmuch and "mute" -- useful to anyone?
[notmuch-archives.git] / 14 / c2de86f056894794d10ce0cb7ffb29847995cd
1 Return-Path: <bremner@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id CD7E5429E21\r
6         for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 04:07:16 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id eAa1V73w7zra for <notmuch@notmuchmail.org>;\r
16         Tue, 10 Jan 2012 04:07:16 -0800 (PST)\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C3083431FD0\r
21         for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 04:07:15 -0800 (PST)\r
22 Received: from zancas.localnet\r
23         (fctnnbsc36w-156034072155.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
24         [156.34.72.155]) (authenticated bits=0)\r
25         by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q0AC7AeA029347\r
26         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
27         Tue, 10 Jan 2012 08:07:11 -0400\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1RkaTu-0002k9-KK; Tue, 10 Jan 2012 08:07:10 -0400\r
31 From: David Bremner <david@tethera.net>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 1/2] uncrustify.cfg: initial support for notmuch coding style\r
34 Date: Tue, 10 Jan 2012 08:07:07 -0400\r
35 Message-Id: <1326197228-10356-2-git-send-email-david@tethera.net>\r
36 X-Mailer: git-send-email 1.7.7.3\r
37 In-Reply-To: <1326197228-10356-1-git-send-email-david@tethera.net>\r
38 References: <1324135695-15487-1-git-send-email-david@tethera.net>\r
39         <1326197228-10356-1-git-send-email-david@tethera.net>\r
40 Cc: David Bremner <bremner@debian.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Tue, 10 Jan 2012 12:07:17 -0000\r
54 \r
55 From: David Bremner <bremner@debian.org>\r
56 \r
57 Uncrustify is a free (as in GPL2+) tool that indents and beautifies\r
58 C/C++ code. It is similar to GNU indent in functionality although\r
59 probably more configurable (in fairness, indent has better\r
60 documentation).  Uncrustify does not have the indent mis-feature of\r
61 needing to have every typedef'ed type defined in the\r
62 configuration (even standard types like size_t).\r
63 \r
64 This configuration starts with the linux-kernel style from the\r
65 uncrustify config, disables aggressive re-indenting of structs,\r
66 and fine tunes the handling 'else' and braces.\r
67 \r
68 In an ideal situation, running uncrustify on notmuch code would be\r
69 NOP; currently this is not true for all files because 1) the\r
70 configuration is not perfect 2) the coding style of notmuch is not\r
71 completely consistent; in particular the treatment of braces after\r
72 e.g. for (_) is not consistent.\r
73 ---\r
74  uncrustify.cfg |   99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
75  1 files changed, 99 insertions(+), 0 deletions(-)\r
76  create mode 100644 uncrustify.cfg\r
77 \r
78 diff --git a/uncrustify.cfg b/uncrustify.cfg\r
79 new file mode 100644\r
80 index 0000000..6613425\r
81 --- /dev/null\r
82 +++ b/uncrustify.cfg\r
83 @@ -0,0 +1,99 @@\r
84 +#\r
85 +# uncrustify config file for the linux kernel\r
86 +#\r
87 +# $Id: linux-indent.cfg 488 2006-09-09 12:44:38Z bengardner $\r
88 +# Taken from the uncrustify distribution under license (GPL2+)\r
89 +#\r
90 +# sample usage:\r
91 +#        uncrustify --replace -c uncrustify.cfg foo.c\r
92 +#\r
93 +#\r
94 +\r
95 +indent_with_tabs       = 2             # 1=indent to level only, 2=indent with tabs\r
96 +align_with_tabs                = TRUE          # use tabs to align\r
97 +align_on_tabstop       = TRUE          # align on tabstops\r
98 +input_tab_size         = 8             # original tab size\r
99 +output_tab_size                = 8             # new tab size\r
100 +indent_columns         = 4\r
101 +\r
102 +indent_label           = 2             # pos: absolute col, neg: relative column\r
103 +\r
104 +\r
105 +#\r
106 +# inter-symbol newlines\r
107 +#\r
108 +\r
109 +nl_enum_brace          = remove        # "enum {" vs "enum \n {"\r
110 +nl_union_brace         = remove        # "union {" vs "union \n {"\r
111 +nl_struct_brace                = remove        # "struct {" vs "struct \n {"\r
112 +nl_do_brace             = remove       # "do {" vs "do \n {"\r
113 +nl_if_brace             = remove       # "if () {" vs "if () \n {"\r
114 +nl_for_brace            = remove       # "for () {" vs "for () \n {"\r
115 +nl_else_brace           = remove       # "else {" vs "else \n {"\r
116 +nl_while_brace          = remove       # "while () {" vs "while () \n {"\r
117 +nl_switch_brace         = remove       # "switch () {" vs "switch () \n {"\r
118 +nl_brace_while         = remove        # "} while" vs "} \n while" - cuddle while\r
119 +nl_brace_else          = remove        # "} else" vs "} \n else" - cuddle else\r
120 +nl_func_var_def_blk    = 1\r
121 +nl_fcall_brace         = remove        # "list_for_each() {" vs "list_for_each()\n{"\r
122 +nl_fdef_brace          = force         # "int foo() {" vs "int foo()\n{"\r
123 +# nl_after_return              = TRUE;\r
124 +# nl_before_case       = 1\r
125 +\r
126 +# Add or remove newline between return type and function name in definition\r
127 +nl_func_type_name      = force\r
128 +\r
129 +#\r
130 +# Source code modifications\r
131 +#\r
132 +\r
133 +# mod_paren_on_return  = remove        # "return 1;" vs "return (1);"\r
134 +# mod_full_brace_if    = remove        # "if (a) a--;" vs "if (a) { a--; }"\r
135 +# mod_full_brace_for   = remove        # "for () a--;" vs "for () { a--; }"\r
136 +# mod_full_brace_do    = remove        # "do a--; while ();" vs "do { a--; } while ();"\r
137 +# mod_full_brace_while = remove        # "while (a) a--;" vs "while (a) { a--; }"\r
138 +\r
139 +\r
140 +#\r
141 +# inter-character spacing options\r
142 +#\r
143 +\r
144 +# sp _return_paren     = force         # "return (1);" vs "return(1);"\r
145 +sp_sizeof_paren                = remove        # "sizeof (int)" vs "sizeof(int)"\r
146 +sp_before_sparen       = force         # "if (" vs "if("\r
147 +sp_after_sparen                = force         # "if () {" vs "if (){"\r
148 +sp_sparen_brace                = force\r
149 +sp_after_cast          = force         # "(int) a" vs "(int)a"\r
150 +sp_inside_braces       = add           # "{ 1 }" vs "{1}"\r
151 +sp_inside_braces_struct        = add           # "{ 1 }" vs "{1}"\r
152 +sp_inside_braces_enum  = add           # "{ 1 }" vs "{1}"\r
153 +sp_assign              = force\r
154 +sp_arith               = force\r
155 +sp_bool                        = add\r
156 +sp_compare             = add\r
157 +sp_assign              = add\r
158 +sp_after_comma         = add\r
159 +sp_func_def_paren      = force         # "int foo (){" vs "int foo(){"\r
160 +sp_func_call_paren     = force         # "foo (" vs "foo("\r
161 +sp_func_proto_paren    = force         # "int foo ();" vs "int foo();"\r
162 +sp_brace_else          = force         # "} else" vs "}else"\r
163 +sp_else_brace          = force         # "else {" vs "else{"\r
164 +#\r
165 +# Aligning stuff\r
166 +#\r
167 +\r
168 +align_enum_equ_span    = 4             # '=' in enum definition\r
169 +# align_nl_cont                = TRUE\r
170 +# align_var_def_span   = 2\r
171 +# align_var_def_inline = TRUE\r
172 +# align_var_def_star   = FALSE\r
173 +# align_var_def_colon  = TRUE\r
174 +# align_assign_span    = 1\r
175 +align_struct_init_span = 0             # align stuff in a structure init '= { }'\r
176 +align_right_cmt_span   = 0\r
177 +# align_pp_define_span = 8;\r
178 +# align_pp_define_gap  = 4;\r
179 +\r
180 +# cmt_star_cont                = FALSE\r
181 +\r
182 +# indent_brace         = 0\r
183 -- \r
184 1.7.7.3\r
185 \r