unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] uncrustify.cfg: comments and more types
@ 2012-01-25 21:37 Tomi Ollila
  2012-01-28 11:59 ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: Tomi Ollila @ 2012-01-25 21:37 UTC (permalink / raw)
  To: notmuch; +Cc: Tomi Ollila

Changes to devel/uncrustify.cfg:

* Updated header comment to state this is config file for *notmuch*.
* Mentioned in header commit that uncrustify version 0.59 required.
* Use tabs to indent/align comments.
* Added comment about the reason of 'type' keyword used.
* Added some more custom types woth 'type' keyword.
* Have (every) multiline comment lines start with '*'.
---
 devel/uncrustify.cfg |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/devel/uncrustify.cfg b/devel/uncrustify.cfg
index d8075ba..92bb29b 100644
--- a/devel/uncrustify.cfg
+++ b/devel/uncrustify.cfg
@@ -1,13 +1,15 @@
 #
-# uncrustify config file for the linux kernel
+# Uncrustify config file for notmuch.
+# Based on uncrustify config file for the linux kernel
 #
 # $Id: linux-indent.cfg 488 2006-09-09 12:44:38Z bengardner $
 # Taken from the uncrustify distribution under license (GPL2+)
 #
-# sample usage:
+# Sample usage:
 #        uncrustify --replace -c uncrustify.cfg foo.c
 #
-#
+# Note: for proper output, uncrustify version 0.59 is required.
+# (without indent_cmt_with_tabs this may work ok with 0.58 (and possibly older)
 
 indent_with_tabs	= 2		# 1=indent to level only, 2=indent with tabs
 align_with_tabs		= TRUE		# use tabs to align
@@ -18,6 +20,8 @@ indent_columns		= 4
 
 indent_label		= -2		# pos: absolute col, neg: relative column
 
+indent_cmt_with_tabs	= true		# use tabs to indent/align comments
+
 #
 # inter-symbol newlines
 #
@@ -54,11 +58,14 @@ nl_after_struct = 0
 # mod_full_brace_do	= remove	# "do a--; while ();" vs "do { a--; } while ();"
 # mod_full_brace_while	= remove	# "while (a) a--;" vs "while (a) { a--; }"
 
-#
-# Extra types used in notmuch source.
-# (add more on demand)
 
-type GMimeObject mime_node_t
+# In case some custom types aren't detected properly by uncrustify
+# add those to this section below. For example there are cases where
+# uncrustify doesn't know whether a 'token' is part of pointer type
+# or left operand of a binary multiplication operation. 
+
+type GMimeObject GMimeCryptoContext GMimeCipherContext
+type mime_node_t notmuch_message_t
 
 #
 # inter-character spacing options
@@ -107,7 +114,6 @@ align_right_cmt_span	= 8		# align comments span this much in func
 # align_pp_define_span	= 8;
 # align_pp_define_gap	= 4;
 
-# cmt_star_cont		= FALSE
+cmt_star_cont		= true
 
 # indent_brace		= 0
-- 
1.7.8.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] uncrustify.cfg: comments and more types
  2012-01-25 21:37 Tomi Ollila
@ 2012-01-28 11:59 ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2012-01-28 11:59 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

On Wed, 25 Jan 2012 23:37:45 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> Changes to devel/uncrustify.cfg:

I'm not sure why (because there should not be intervening changes), but
this does not apply to current master. From git am -3, I get

,----
| Using index info to reconstruct a base tree...
| <stdin>:49: trailing whitespace.
| # or left operand of a binary multiplication operation. 
| error: patch failed: devel/uncrustify.cfg:107
| error: devel/uncrustify.cfg: patch does not apply
| Did you hand edit your patch?
| It does not apply to blobs recorded in its index.
| Cannot fall back to three-way merge.
| Patch failed at 0001 uncrustify.cfg: comments and more types
| When you have resolved this problem run "git am --resolved".
`----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] uncrustify.cfg: comments and more types
       [not found] <id:"1327527465-10321-1-git-send-email-tomi.ollila@iki.fi">
@ 2012-02-07 16:34 ` Tomi Ollila
  2012-06-03 16:44   ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: Tomi Ollila @ 2012-02-07 16:34 UTC (permalink / raw)
  To: notmuch; +Cc: Tomi Ollila

Changes to devel/uncrustify.cfg:

* Updated header comment to state this is config file for *notmuch*.
* Added comment about the reason of 'type' keyword used.
* Added some more custom types woth 'type' keyword.
* Have (every) multiline comment lines start with '*'.
---
 devel/uncrustify.cfg |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/devel/uncrustify.cfg b/devel/uncrustify.cfg
index d8075ba..bab9761 100644
--- a/devel/uncrustify.cfg
+++ b/devel/uncrustify.cfg
@@ -1,13 +1,13 @@
 #
-# uncrustify config file for the linux kernel
+# Uncrustify config file for notmuch.
+# Based on uncrustify config file for the linux kernel
 #
 # $Id: linux-indent.cfg 488 2006-09-09 12:44:38Z bengardner $
 # Taken from the uncrustify distribution under license (GPL2+)
 #
-# sample usage:
+# Sample usage:
 #        uncrustify --replace -c uncrustify.cfg foo.c
 #
-#
 
 indent_with_tabs	= 2		# 1=indent to level only, 2=indent with tabs
 align_with_tabs		= TRUE		# use tabs to align
@@ -18,6 +18,8 @@ indent_columns		= 4
 
 indent_label		= -2		# pos: absolute col, neg: relative column
 
+indent_cmt_with_tabs	= false		# true would align to tabstop always...
+
 #
 # inter-symbol newlines
 #
@@ -54,11 +56,14 @@ nl_after_struct = 0
 # mod_full_brace_do	= remove	# "do a--; while ();" vs "do { a--; } while ();"
 # mod_full_brace_while	= remove	# "while (a) a--;" vs "while (a) { a--; }"
 
-#
-# Extra types used in notmuch source.
-# (add more on demand)
 
-type GMimeObject mime_node_t
+# In case some custom types aren't detected properly by uncrustify
+# add those to this section below. For example there are cases where
+# uncrustify doesn't know whether a 'token' is part of pointer type
+# or left operand of a binary multiplication operation.
+
+type GMimeObject GMimeCryptoContext GMimeCipherContext
+type mime_node_t notmuch_message_t
 
 #
 # inter-character spacing options
@@ -107,6 +112,6 @@ align_right_cmt_span	= 8		# align comments span this much in func
 # align_pp_define_span	= 8;
 # align_pp_define_gap	= 4;
 
-# cmt_star_cont		= FALSE
+cmt_star_cont		= true
 
 # indent_brace		= 0
-- 
1.7.6.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] uncrustify.cfg: comments and more types
  2012-02-07 16:34 ` [PATCH] uncrustify.cfg: comments and more types Tomi Ollila
@ 2012-06-03 16:44   ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2012-06-03 16:44 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> Changes to devel/uncrustify.cfg:
>
> * Updated header comment to state this is config file for *notmuch*.
> * Added comment about the reason of 'type' keyword used.
> * Added some more custom types woth 'type' keyword.
> * Have (every) multiline comment lines start with '*'.

This seemed OK to me, and since it is pretty low risk, I (finally)
pushed it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-03 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <id:"1327527465-10321-1-git-send-email-tomi.ollila@iki.fi">
2012-02-07 16:34 ` [PATCH] uncrustify.cfg: comments and more types Tomi Ollila
2012-06-03 16:44   ` David Bremner
2012-01-25 21:37 Tomi Ollila
2012-01-28 11:59 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).