From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Andy Whitcroft <apw@canonical.com>
Cc: Greg KH <greg@kroah.com>, Jonathan Corbet <corbet@lwn.net>,
Josh Triplett <josh@joshtriplett.org>,
Christian Borntraeger <borntraeger@de.ibm.com>,
"Theodore Ts'o" <tytso@mit.edu>,
linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: Minimize checkpatch induced patches...
Date: Wed, 14 Sep 2016 10:51:15 -0700 [thread overview]
Message-ID: <bb0fd4fc28b844ac9b63a58c9ffd24a88f7f78cc.1473875340.git.joe@perches.com> (raw)
checkpatch can be a useful tool for patches.
It can be a much more controversial tool when used on files with the
-f option for style and whitespace changes for code that is relatively
stable, obsolete, or for maintained by specific individuals.
o By default, allow checkpatch to be used with the -f|--file option
for files in drivers/staging/
o Add an undocumented --force command line option to be used together
with the -f|--file option to scan any file
Signed-off-by: Joe Perches <joe@perches.com>
cc: Greg KH <greg@kroah.com>
cc: Jonathan Corbet <corbet@lwn.net>
cc: Josh Triplett <josh@joshtriplett.org>
cc: Christian Borntraeger <borntraeger@de.ibm.com>
cc: Theodore Ts'o <tytso@mit.edu>
---
scripts/checkpatch.pl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0ef3d83..d998a61 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -27,6 +27,7 @@ my $emacs = 0;
my $terse = 0;
my $showfile = 0;
my $file = 0;
+my $force = 0;
my $git = 0;
my %git_commits = ();
my $check = 0;
@@ -188,6 +189,7 @@ GetOptions(
'terse!' => \$terse,
'showfile!' => \$showfile,
'f|file!' => \$file,
+ 'force!' => \$force,
'g|git!' => \$git,
'subjective!' => \$check,
'strict!' => \$check,
@@ -893,6 +895,10 @@ if ($git) {
my $vname;
for my $filename (@ARGV) {
my $FILE;
+ if (!$force && $file && $filename !~ m@^drivers/staging/@) {
+ warn "$P: checking '$filename' is not supported\n";
+ next;
+ }
if ($git) {
open($FILE, '-|', "git format-patch -M --stdout -1 $filename") ||
die "$P: $filename: git format-patch failed - $!\n";
--
2.10.0.rc2.1.g053435c
next reply other threads:[~2016-09-14 17:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 17:51 Joe Perches [this message]
2016-09-14 17:56 ` Christian Borntraeger
2016-09-14 18:06 ` Joe Perches
2016-09-14 18:16 ` Christian Borntraeger
2016-09-14 18:21 ` Joe Perches
2016-09-14 18:24 ` Christian Borntraeger
2016-09-14 18:33 ` Greg KH
2016-09-14 18:54 ` Christian Borntraeger
2016-09-14 19:09 ` Joe Perches
2016-09-18 19:38 ` Christian Borntraeger
2016-09-14 23:54 ` Josh Triplett
2016-09-15 0:05 ` Joe Perches
2016-09-15 0:09 ` Josh Triplett
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=bb0fd4fc28b844ac9b63a58c9ffd24a88f7f78cc.1473875340.git.joe@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=borntraeger@de.ibm.com \
--cc=corbet@lwn.net \
--cc=greg@kroah.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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®