Re: [PATCH 1/8] STYLE: document rules for calls, block comments, ternary ops

Subject: Re: [PATCH 1/8] STYLE: document rules for calls, block comments, ternary ops

Date: Thu, 13 Jun 2019 08:12:01 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


David Bremner <david@tethera.net> writes:

> ---
>  devel/STYLE | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/devel/STYLE b/devel/STYLE
> index da653124..aa9f0f3d 100644
> --- a/devel/STYLE
> +++ b/devel/STYLE
> @@ -53,11 +53,18 @@ function (param_type param, param_type param)
>    if/for/while test) and are preceded by a space. The opening brace of
>    functions is the exception, and starts on a new line.
>  
> -* Comments are always C-style /* */ block comments.  They should start
> -  with a capital letter and generally be written in complete
> -  sentences.  Public library functions are documented immediately
> -  before their prototype in lib/notmuch.h.  Internal functions are
> -  typically documented immediately before their definition.
> +* Opening parens also cuddle, even if the first argument does not fit
> +  on the same line.
> +
> +* Nested ternary operators should be parenthesized at least as as much
> +  as "a ? (b ? c : d)"

This rule is uh, invalid C. So that needs to be updated.  The scenario
I was trying to describe is

foo = a ? (
    b ) : d

(it turns out nesting isn't the main point). This is really just a hack
to make uncrustify and emacs alignment match.
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: