All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Frysinger <vapier@gentoo.org>, "Ted Ts'o" <tytso@mit.edu>,
	Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: allow single space before labels
Date: Mon, 18 Oct 2010 12:09:47 -0700	[thread overview]
Message-ID: <1287428987.20968.156.camel@Joe-Laptop> (raw)
In-Reply-To: <1287426752.1998.2099.camel@laptop>

On Mon, 2010-10-18 at 20:32 +0200, Peter Zijlstra wrote:
> On Mon, 2010-10-18 at 14:21 -0400, Mike Frysinger wrote:
> > sounds like an ACK for Joe's patch

I didn't submit a patch, I suggested a possible improvement to
your patch.  If you agree with it, you could resubmit.

> There are checks I don't really like, for those I simply ignore its
> output, I suggest others do the same.

Seems sensible.

Mike, checkpatch does already allow a single space to precede
a label but there's a conflict between the leading spaces test
and this test below it, so something like your patch is useful.

----------------
#goto labels aren't indented, allow a single space however
		if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
		   !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
			WARN("labels should not be indented\n" . $herecurr);
		}
----------------

The leading space test may be overly noisy.
Maybe Andy can fix it a different way.

About 1% (~500) of the labels in the kernel source tree use
leading tabs.  I think that label style is harder for me to
visually scan and find, but it's probably not code I'd change
just for conformity.


  reply	other threads:[~2010-10-18 19:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17  8:05 [PATCH] checkpatch: allow single space before labels Mike Frysinger
2010-10-17  8:21 ` Joe Perches
2010-10-17  8:24   ` Mike Frysinger
2010-10-17 10:21     ` Peter Zijlstra
2010-10-17 10:30       ` Mike Frysinger
2010-10-17 10:37         ` Peter Zijlstra
2010-10-17 10:52           ` Mike Frysinger
2010-10-17 16:54       ` Joe Perches
2010-10-17 19:30         ` Peter Zijlstra
2010-10-17 19:38           ` Joe Perches
2010-10-17 19:49             ` Peter Zijlstra
2010-10-17 19:49           ` Mike Frysinger
2010-10-17 20:01             ` Peter Zijlstra
2010-10-17 20:26               ` Mike Frysinger
2010-10-18 14:39                 ` Ted Ts'o
2010-10-18 14:54                   ` Ted Ts'o
2010-10-18 14:58                     ` Peter Zijlstra
2010-10-18 15:03                       ` Peter Zijlstra
2010-10-18 18:21                       ` Mike Frysinger
2010-10-18 18:32                         ` Peter Zijlstra
2010-10-18 19:09                           ` Joe Perches [this message]
2010-10-17 10:20 ` Peter Zijlstra

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=1287428987.20968.156.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tytso@mit.edu \
    --cc=vapier@gentoo.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.