[PATCH] uncrustify.cfg: initial support for notmuch coding style
authorDavid Bremner <david@tethera.net>
Sat, 17 Dec 2011 15:28:15 +0000 (11:28 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:58 +0000 (09:40 -0800)
c1/637c6ca29babcbdc44b4211eae601f2173862f [new file with mode: 0644]

diff --git a/c1/637c6ca29babcbdc44b4211eae601f2173862f b/c1/637c6ca29babcbdc44b4211eae601f2173862f
new file mode 100644 (file)
index 0000000..038b4e8
--- /dev/null
@@ -0,0 +1,177 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id EA123429E25\r
+       for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 07:28:28 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 4CZ1L543gHEM for <notmuch@notmuchmail.org>;\r
+       Sat, 17 Dec 2011 07:28:28 -0800 (PST)\r
+Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id EDC81431FB6\r
+       for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 07:28:27 -0800 (PST)\r
+Received: from zancas.localnet\r
+       (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
+       [156.34.79.193]) (authenticated bits=0)\r
+       by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pBHFSLa3030971\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
+       Sat, 17 Dec 2011 11:28:24 -0400\r
+Received: from bremner by zancas.localnet with local (Exim 4.77)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1RbwBQ-00042K-Pw; Sat, 17 Dec 2011 11:28:20 -0400\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] uncrustify.cfg: initial support for notmuch coding style\r
+Date: Sat, 17 Dec 2011 11:28:15 -0400\r
+Message-Id: <1324135695-15487-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.7.3\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 17 Dec 2011 15:28:29 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+Uncrustify is a free (as in GPL2+) tool that indents and beautifies\r
+C/C++ code. It is similar to GNU indent in functionality although\r
+probably more configurable (in fairness, indent has better\r
+documentation).  Uncrustify does not have the indent mis-feature of\r
+needing to have every typedef'ed type defined in the\r
+configuration (even standard types like size_t).\r
+\r
+In an ideal situation, running uncrustify on notmuch code would be\r
+NOP; currently this is not true for all files because 1) the\r
+configuration is not perfect 2) the coding style of notmuch is not\r
+completely consistent; in particular the treatment of braces after\r
+e.g. for (_) is not consistent.\r
+---\r
+ uncrustify.cfg |   98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 files changed, 98 insertions(+), 0 deletions(-)\r
+ create mode 100644 uncrustify.cfg\r
+\r
+diff --git a/uncrustify.cfg b/uncrustify.cfg\r
+new file mode 100644\r
+index 0000000..7eab7c4\r
+--- /dev/null\r
++++ b/uncrustify.cfg\r
+@@ -0,0 +1,98 @@\r
++#\r
++# uncrustify config file for the linux kernel\r
++#\r
++# $Id: linux-indent.cfg 488 2006-09-09 12:44:38Z bengardner $\r
++# Taken from the uncrustify distribution under license (GPL2+)\r
++#\r
++# sample usage:\r
++#        uncrustify --replace -c uncrustify.cfg foo.c\r
++#\r
++#\r
++\r
++indent_with_tabs      = 2             # 1=indent to level only, 2=indent with tabs\r
++align_with_tabs               = TRUE          # use tabs to align\r
++align_on_tabstop      = TRUE          # align on tabstops\r
++input_tab_size                = 8             # original tab size\r
++output_tab_size               = 8             # new tab size\r
++indent_columns                = 4\r
++\r
++indent_label          = 2             # pos: absolute col, neg: relative column\r
++\r
++\r
++#\r
++# inter-symbol newlines\r
++#\r
++\r
++nl_enum_brace         = remove        # "enum {" vs "enum \n {"\r
++nl_union_brace                = remove        # "union {" vs "union \n {"\r
++nl_struct_brace               = remove        # "struct {" vs "struct \n {"\r
++nl_do_brace             = remove      # "do {" vs "do \n {"\r
++nl_if_brace             = remove      # "if () {" vs "if () \n {"\r
++nl_for_brace            = remove      # "for () {" vs "for () \n {"\r
++nl_else_brace           = remove      # "else {" vs "else \n {"\r
++nl_while_brace          = remove      # "while () {" vs "while () \n {"\r
++nl_switch_brace         = remove      # "switch () {" vs "switch () \n {"\r
++nl_brace_while                = remove        # "} while" vs "} \n while" - cuddle while\r
++nl_brace_else         = remove        # "} else" vs "} \n else" - cuddle else\r
++nl_func_var_def_blk   = 1\r
++nl_fcall_brace                = remove        # "list_for_each() {" vs "list_for_each()\n{"\r
++nl_fdef_brace         = force         # "int foo() {" vs "int foo()\n{"\r
++# nl_after_return             = TRUE;\r
++# nl_before_case      = 1\r
++\r
++# Add or remove newline between return type and function name in definition\r
++nl_func_type_name     = force\r
++\r
++#\r
++# Source code modifications\r
++#\r
++\r
++# mod_paren_on_return = remove        # "return 1;" vs "return (1);"\r
++# mod_full_brace_if   = remove        # "if (a) a--;" vs "if (a) { a--; }"\r
++# mod_full_brace_for  = remove        # "for () a--;" vs "for () { a--; }"\r
++# mod_full_brace_do   = remove        # "do a--; while ();" vs "do { a--; } while ();"\r
++# mod_full_brace_while        = remove        # "while (a) a--;" vs "while (a) { a--; }"\r
++\r
++\r
++#\r
++# inter-character spacing options\r
++#\r
++\r
++# sp _return_paren    = force         # "return (1);" vs "return(1);"\r
++sp_sizeof_paren               = remove        # "sizeof (int)" vs "sizeof(int)"\r
++sp_before_sparen      = force         # "if (" vs "if("\r
++sp_after_sparen               = force         # "if () {" vs "if (){"\r
++sp_sparen_brace               = force\r
++sp_after_cast         = force         # "(int) a" vs "(int)a"\r
++sp_inside_braces      = add           # "{ 1 }" vs "{1}"\r
++sp_inside_braces_struct       = add           # "{ 1 }" vs "{1}"\r
++sp_inside_braces_enum = add           # "{ 1 }" vs "{1}"\r
++sp_assign             = force\r
++sp_arith              = force\r
++sp_bool                       = add\r
++sp_compare            = add\r
++sp_assign             = add\r
++sp_after_comma                = add\r
++sp_func_def_paren     = force         # "int foo (){" vs "int foo(){"\r
++sp_func_call_paren    = force         # "foo (" vs "foo("\r
++sp_func_proto_paren   = force         # "int foo ();" vs "int foo();"\r
++\r
++#\r
++# Aligning stuff\r
++#\r
++\r
++align_enum_equ_span   = 4             # '=' in enum definition\r
++# align_nl_cont               = TRUE\r
++# align_var_def_span  = 2\r
++# align_var_def_inline        = TRUE\r
++# align_var_def_star  = FALSE\r
++# align_var_def_colon = TRUE\r
++# align_assign_span   = 1\r
++align_struct_init_span        = 3             # align stuff in a structure init '= { }'\r
++align_right_cmt_span  = 3\r
++# align_pp_define_span        = 8;\r
++# align_pp_define_gap = 4;\r
++\r
++# cmt_star_cont               = FALSE\r
++\r
++# indent_brace                = 0\r
+-- \r
+1.7.7.3\r
+\r