checkpatch: do not try to sanity test cover letters
PATCH 1/1 checkpatch: do not try to sanity test cover letters
One possibly common workflow is this:
git format-patch -o mypatches --cover-letter ^start end ./scripts/checkpatch.pl mypatches/*
The problem with the above is that checkpatch.pl will try to parse the cover-letter, and of course complain that it can not find any unified diff within.
It is pretty safe for us to assume "0000-cover-letter.patch" is not in fact a patch and simply skip processing of it.
---
[what I know about perl could be written on the back of a postage
stamp in crayon, so please feel free to reimplement the overall concept of this change as you see fit.... ]
scripts/checkpatch.pl +5 -0
@@ -6,6 +6,7 @@ # Licensed under the terms of the GNU GPL License version 2 use strict; +use File::Basename; my $P = $0; $P =~ s@.*/@@g;
@@ -382,6 +383,10 @@ for my $filename (@ARGV) { open($FILE, '<', "$filename") || die "$P: $filename: open failed - $!\n"; } + if (basename($filename) eq '0000-cover-letter.patch') { + print "Skipping cover letter $filename\n"; + next; + } if ($filename eq '-') { $vname = 'Your patch'; } else {
Signature · 1 line
1.7.9.1
Joe Perches
maintainerQuoted 4 lines · Paul Gortmaker
One possibly common workflow is this:
git format-patch -o mypatches --cover-letter ^start end ./scripts/checkpatch.pl mypatches/*
I use a script for this and don't put the check
in checkpatch but put the check in bash.
Quoted 8 lines · Joe Perches
Quoted 4 lines · Paul Gortmaker
One possibly common workflow is this:
git format-patch -o mypatches --cover-letter ^start end
./scripts/checkpatch.plmypatches/*I use a script for this and don't put the check
in checkpatch but put the check in bash.
Sure, and I can do the same. But my question to you is whether you think the above is a common workflow, and if the false positives that it generates will decrease the number of people likely to make using it a part of their routine?
Paul.
--
Quoted 7 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Joe Perches
maintainerQuoted 7 lines · Paul Gortmaker
Quoted 6 lines · Joe Perches
Quoted 4 lines · Paul Gortmaker
One possibly common workflow is this:
git format-patch -o mypatches --cover-letter ^start end ./scripts/checkpatch.pl mypatches/*
Quoted 7 lines
Quoted 2 lines
I use a script for this and don't put the check
in checkpatch but put the check in bash.Sure, and I can do the same. But my question to you is whether you think the above is a common workflow, and if the false positives that it generates will decrease the number of people likely to make using it a part of their routine?
Dunno. I generally think that tools should report errors when the input given them is inappropriate.
cheers, Joe
Andy Whitcroft
maintainerQuoted 11 lines · Joe Perches
Quoted 10 lines · Paul Gortmaker
Quoted 8 lines · Joe Perches
Quoted 4 lines · Paul Gortmaker
One possibly common workflow is this:
git format-patch -o mypatches --cover-letter ^start end ./scripts/checkpatch.pl mypatches/*I use a script for this and don't put the check
in checkpatch but put the check in bash.
Quoted 7 lines
Quoted 4 lines
Sure, and I can do the same. But my question to you is whether you think the above is a common workflow, and if the false positives that it generates will decrease the number of people likely to make using it a part of their routine?
Dunno. I generally think that tools should report errors when the input given them is inappropriate.
Tend to agree, the more complex we make checkpatch the more often it will be wrong. And it is wrong enough already.
-apw