PATCH] patch to generate warning when signed-of line in patch in not proper
From: anish kumar <[email protected]>
This patch generates warning when there is no space between the patch submitter name and successive mail-id.
Signed-off-by anish kumar <[email protected]>
--- scripts/checkpatch.pl | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +8 -2
@@ -1373,10 +1373,16 @@ sub process { WARN("Signed-off-by: is the preferred form\n" . $herecurr); } - if ($line =~ /^\s*signed-off-by:\S/i) { - WARN("space required after Signed-off-by:\n" . + if ($line =~ /^\s*signed-off-by:(.*)/i) { + if($1 !~ /^(\s[a-zA-Z].*)/i) { + WARN("Space required after Signed-off-by:\n" . $herecurr); } + if($1 !~ /[\sa-zA-Z]+\s<.*>/i) { + WARN("Space required between Full Name & Mail-id:\n" . + $herecurr); + } + } } # Check for wrappage within a valid hunk of the file
Signature · 1 line
1.7.0.4
A message that is not in the archive (sent off-list or not yet received): [email protected]
Joe Perches
maintainerQuoted 9 lines · anish singh
Re-sending to get some comments on this.
On Thu, May 19, 2011 at 10:53 PM, anish <[email protected]> wrote:
From: anish kumar <[email protected]>This patch generates warning when there is no space between the
patch submitter name and successive mail-id.
If you do this, why not do it for all signature types?
our $Valid_Signatures "(?:Signed-off-by:|Reviewed-by:|Acked-by:)"
Quoted 10 lines
Signed-off-by: anish kumar <[email protected]> --- scripts/checkpatch.pl | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d867081..437c6d4 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1373,10 +1373,16 @@ sub process {
Quoted 8 lines
WARN("Signed-off-by: is the
preferred form\n" .
$herecurr);
}
- if ($line =~ /^\s*signed-off-by:\S/i)
{
- WARN("space required after
Signed-off-by:\n" . if ($line =~ /^(\s*)($ValidSignatures)(\s*)(.*)$/i) {
my $space_before = $1;
my $sign_off = $2;
my $space_after = $3;
my $email = $4;
if (defined $space_before && $space_before ne "") {
warning (no space before...)
}
if ($sign_off !~ /$Valid_Signature/) {
warning (signature case...)
}
if (!defined $space_after || $space_after ne " ") {
warning (need only one space after colon...)
}
if (!validate_email($4)) {
warning (bad email...)