From: "J. Bruce Fields" <bfields@fieldses.org>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
David Miller <davem@davemloft.net>,
LKML <linux-kernel@vger.kernel.org>,
William Allen Simpson <william.allen.simpson@gmail.com>
Subject: Re: [PATCH] scripts/checkpatch.pl: Add warning about leading contination tests
Date: Mon, 7 Dec 2009 17:05:01 -0500 [thread overview]
Message-ID: <20091207220501.GF32454@fieldses.org> (raw)
In-Reply-To: <1260035884.11126.58.camel@Joe-Laptop.home>
On Sat, Dec 05, 2009 at 09:58:04AM -0800, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index bc4114f..c35933a 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2064,6 +2064,11 @@ sub process {
> CHK("multiple assignments should be avoided\n" . $herecurr);
> }
>
> +# Check use of leading logical continuation tests
> + if ($line =~ /^.\s*(\|\||&&)/) {
> + WARN("Continuation logic should be at end of previous line\n" . $herecurr);
> + }
> +
> ## # check for multiple declarations, allowing for a function declaration
> ## # continuation.
> ## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
Where does this preference come from?
In
excessivelylongcondition
&& anotherreallylongcondition
&& yetanotherunbelievablylongcondition
&& yetanotherwellyougettheidea
I want to be able to keep the &&'s all justified.
Or look for well-typeset math or CS texts and try to find any that leave
operators dangling on the right.
I don't really care much about this particular point, but: the
checkpatch output is already getting too verbose to be useful, without
adding advice that's actually the opposite of what I'd normally want to
do....
--b.
next prev parent reply other threads:[~2009-12-07 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-05 17:58 [PATCH] scripts/checkpatch.pl: Add warning about leading contination tests Joe Perches
2009-12-06 8:35 ` Eric Dumazet
2009-12-06 12:13 ` Jean Delvare
2009-12-06 17:46 ` Joe Perches
2009-12-06 18:53 ` Jean Delvare
2009-12-06 19:08 ` Joe Perches
2009-12-07 22:05 ` J. Bruce Fields [this message]
2009-12-08 0:08 ` William Allen Simpson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091207220501.GF32454@fieldses.org \
--to=bfields@fieldses.org \
--cc=apw@canonical.com \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=william.allen.simpson@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox