mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
To: apw@shadowen.org, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] checkpatch: add filename in the summary
Date: Mon, 14 Jan 2008 23:23:39 +0100	[thread overview]
Message-ID: <20080114232339.2c018647@paolo-desktop> (raw)

Add a filename option (default to 0)
in order to get the following summary output:
./scripts/checkpatch.pl --filename --file ./arch/sparc/kernel/apc.c 
...
...
...
./arch/sparc/kernel/apc.c --> total: 18 errors, 3 warnings, 186 lines checked
---

Andy, 
I wonder why checkpatch doesn't show all the command line options. 
At the moment, it only prints:
options: -q           => quiet
	--no-tree    => run without a kernel tree
        --terse      => one line per report
        --emacs      => emacs compile window format
        --file       => check a source file
        --strict     => enable more subjective tests
        --root       => path to the kernel tree root

but I see a lot more options:
	q|quiet
	tree
	signoff
	patch
	test-type
	emacs
	terse
	file
	subjective
	strict
	root=s
	summary
	mailback


 scripts/checkpatch.pl |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 579f50f..1762b73 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -24,6 +24,7 @@ my $file = 0;
 my $check = 0;
 my $summary = 1;
 my $mailback = 0;
+my $patchfilename= 0;
 my $root;
 GetOptions(
 	'q|quiet+'	=> \$quiet,
@@ -39,6 +40,7 @@ GetOptions(
 	'root=s'	=> \$root,
 	'summary!'	=> \$summary,
 	'mailback!'	=> \$mailback,
+	'filename'	=> \$patchfilename,
 ) or exit;
 
 my $exit = 0;
@@ -1579,12 +1581,18 @@ sub process {
 	}
 
 	print report_dump();
-	if ($summary) {
+	if ($summary == 1 && $patchfilename == 0) {
 		print "total: $cnt_error errors, $cnt_warn warnings, " .
 			(($check)? "$cnt_chk checks, " : "") .
 			"$cnt_lines lines checked\n";
 		print "\n" if ($quiet == 0);
 	}
+	if ($summary == 1 && $patchfilename == 1) {
+		print "$filename --> total: $cnt_error errors, $cnt_warn warnings, " .
+			(($check)? "$cnt_chk checks, " : "") .
+			"$cnt_lines lines checked\n";
+		print "\n" if ($quiet == 0);
+	}
 
 	if ($clean == 1 && $quiet == 0) {
 		print "Your patch has no obvious style problems and is ready for submission.\n"
-- 
1.5.4.rc3


             reply	other threads:[~2008-01-14 22:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 22:23 Paolo Ciarrocchi [this message]
2008-01-15 18:30 ` Cyrill Gorcunov
2008-01-15 18:43   ` Paolo Ciarrocchi
2008-01-15 18:49     ` Cyrill Gorcunov
2008-01-22 13:20 ` Paolo Ciarrocchi
2008-01-28 14:38   ` Andy Whitcroft

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=20080114232339.2c018647@paolo-desktop \
    --to=paolo.ciarrocchi@gmail.com \
    --cc=apw@shadowen.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®