From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 424BE6DE105B for ; Thu, 13 Jun 2019 04:11:49 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.049 X-Spam-Level: X-Spam-Status: No, score=-0.049 tagged_above=-999 required=5 tests=[AWL=-0.048, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dnTRMcVjrpDS for ; Thu, 13 Jun 2019 04:11:48 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 9C4EF6DE0FC5 for ; Thu, 13 Jun 2019 04:11:48 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hbNdz-0007jB-RP for notmuch@notmuchmail.org; Thu, 13 Jun 2019 07:11:47 -0400 Received: (nullmailer pid 9850 invoked by uid 1000); Thu, 13 Jun 2019 11:12:01 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [PATCH 1/8] STYLE: document rules for calls, block comments, ternary ops In-Reply-To: <20190613110837.6256-2-david@tethera.net> References: <20190613110837.6256-1-david@tethera.net> <20190613110837.6256-2-david@tethera.net> Date: Thu, 13 Jun 2019 08:12:01 -0300 Message-ID: <878su5d9j2.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jun 2019 11:11:49 -0000 David Bremner 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.