qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 1/2] checkpatch.pl: add --no-fail-on-warn option
Date: Fri,  1 Apr 2011 10:20:54 -0500	[thread overview]
Message-ID: <1301671255-27717-2-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1301671255-27717-1-git-send-email-mdroth@linux.vnet.ibm.com>

checkpatch.pl complains about some things that are not strictly against
QEMU's coding style guidelines. It's good to print these, but we
shouldn't force a fail on these as it makes it difficult to automate
checkpatch.pl runs. If we're supposed to fail on these cases, they
should be handled as errors rather than warnings.

For now, however, just add a flag that enables this behavior.

Any functionality triggered by $clean = 0 is still handled as it was
previously.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 scripts/checkpatch.pl |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 075b614..770d534 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -28,6 +28,7 @@ my $mailback = 0;
 my $summary_file = 0;
 my $root;
 my %debug;
+my $no_fail_on_warn = 0;
 my $help = 0;
 
 sub help {
@@ -55,6 +56,7 @@ Options:
                              is all off)
   --test-only=WORD           report only warnings/errors containing WORD
                              literally
+  --no-fail-on-warn          print warnings, but don't fail on them
   -h, --help, --version      display this help and exit
 
 When FILE is - read standard input.
@@ -80,6 +82,7 @@ GetOptions(
 
 	'debug=s'	=> \%debug,
 	'test-only=s'	=> \$tst_only,
+	'no-fail-on-warn' => \$no_fail_on_warn,
 	'h|help'	=> \$help,
 	'version'	=> \$help
 ) or help(1);
@@ -1104,18 +1107,23 @@ sub report_dump {
 sub ERROR {
 	if (report("ERROR: $_[0]\n")) {
 		our $clean = 0;
+		our $passable = 0;
 		our $cnt_error++;
 	}
 }
 sub WARN {
 	if (report("WARNING: $_[0]\n")) {
 		our $clean = 0;
+		if ($no_fail_on_warn == 0) {
+			our $passable = 0;
+		}
 		our $cnt_warn++;
 	}
 }
 sub CHK {
 	if ($check && report("CHECK: $_[0]\n")) {
 		our $clean = 0;
+		our $passable = 0;
 		our $cnt_chk++;
 	}
 }
@@ -1162,6 +1170,7 @@ sub process {
 	my $stashindent=0;
 
 	our $clean = 1;
+	our $passable = 1;
 	my $signoff = 0;
 	my $is_patch = 0;
 
@@ -2906,5 +2915,5 @@ sub process {
 		print "CHECKPATCH in MAINTAINERS.\n";
 	}
 
-	return $clean;
+	return $passable;
 }
-- 
1.7.0.4

  reply	other threads:[~2011-04-01 15:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 15:20 [Qemu-devel] checkpatch.pl: warn on C99 comments, but don't fail Michael Roth
2011-04-01 15:20 ` Michael Roth [this message]
2011-04-01 15:20 ` [Qemu-devel] [PATCH 2/2] checkpatch.pl: make C99 comments a warning, not error Michael Roth
2011-04-01 15:33   ` [Qemu-devel] " Michael Roth
2011-04-01 15:49   ` [Qemu-devel] " Stefan Hajnoczi
2011-04-01 18:46   ` Blue Swirl
2011-04-02 14:02     ` Stefan Hajnoczi
2011-04-01 15:52 ` [Qemu-devel] checkpatch.pl: warn on C99 comments, but don't fail Peter Maydell
2011-04-01 15:59   ` Stefan Hajnoczi
2011-04-01 16:16     ` Peter Maydell
2011-04-01 16:55       ` Michael Roth
2011-04-01 16:58         ` Peter Maydell
2011-04-01 17:24           ` Michael Roth
2011-04-01 17:01         ` Stefan Hajnoczi
2011-04-01 17:25           ` Michael Roth
2011-04-02 13:48             ` Stefan Hajnoczi

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=1301671255-27717-2-git-send-email-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).