[PATCH] Deprecate checkpatch.pl --file

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: <apw@...>, <akpm@...>
Date: Tuesday, January 8, 2008 - 12:14 pm

Deprecate checkpatch.pl --file mode; add warning; add --file-force

As discussed on linux-kernel checkpatch.pl only patches for whole
files have a significant cost for the maintenance process. 

Better such changes should be only
done together with other changes. Add a explicit warning about
this; deprecate --file and add a --file-force instead.

Signed-off-by: Andi Kleen <ak@suse.de>

Index: linux/scripts/checkpatch.pl
===================================================================
--- linux.orig/scripts/checkpatch.pl
+++ linux/scripts/checkpatch.pl
@@ -21,6 +21,7 @@ my $tst_type = 0;
 my $emacs = 0;
 my $terse = 0;
 my $file = 0;
+my $file_force = 0;
 my $check = 0;
 my $summary = 1;
 my $mailback = 0;
@@ -34,6 +35,7 @@ GetOptions(
 	'emacs!'	=> \$emacs,
 	'terse!'	=> \$terse,
 	'file!'		=> \$file,
+	'file-force!'	=> \$file_force,
 	'subjective!'	=> \$check,
 	'strict!'	=> \$check,
 	'root=s'	=> \$root,
@@ -50,12 +52,28 @@ if ($#ARGV < 0) {
 	print "         --no-tree    => run without a kernel tree\n";
 	print "         --terse      => one line per report\n";
 	print "         --emacs      => emacs compile window format\n";
-	print "         --file       => check a source file\n";
+	print "         --file       => check a source file (deprecated)\n";
+	print "		--file-force => check a source file\n";
 	print "         --strict     => enable more subjective tests\n";
 	print "         --root       => path to the kernel tree root\n";
 	exit(1);
 }
 
+if ($file) {
+	print <<EOL
+WARNING: Using --file mode. Please do not send patches to linux-kernel
+that change whole existing files if you did not significantly change most
+of the the file for other reasons anyways or just wrote the file newly
+from scratch. Pure code style patches have a significant cost in a
+quickly changing code base like Linux because they cause rejects
+with other changes.
+If you're sure you want to use whole file mode please use --file-force
+EOL
+;
+	exit(1);
+};
+$file = $file_force;
+
 if ($terse) {
 	$emacs = 1;
 	$quiet++;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Deprecate checkpatch.pl --file, Andi Kleen, (Tue Jan 8, 12:14 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Daniel Walker, (Tue Jan 8, 12:50 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Sam Ravnborg, (Tue Jan 8, 1:53 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Bartlomiej Zolnierkiewicz..., (Tue Jan 8, 4:27 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Daniel Walker, (Tue Jan 8, 2:01 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Theodore Tso, (Tue Jan 8, 2:20 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Daniel Walker, (Tue Jan 8, 2:33 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Sam Ravnborg, (Tue Jan 8, 3:21 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Daniel Walker, (Tue Jan 8, 4:19 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Theodore Tso, (Tue Jan 8, 5:14 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Daniel Walker, (Tue Jan 8, 5:50 pm)
Re: [PATCH] Deprecate checkpatch.pl --file, Andi Kleen, (Tue Jan 8, 3:27 pm)