Messages in this thread Patch in this message | | | From | Mark Brown <> | Date | Fri, 27 Feb 2009 18:05:20 +0000 | Subject | [PATCH] checkpatch: Warn on empty commit log bodies |
| |
Try to help ensure that e-mailed patches have some commit log text in the body of the e-mail by warning if we can't find any lines that look like a header of some kind prior to the Signed-off-by.
Signed-off-by: Mark Brown <broonie@sirena.org.uk> --- scripts/checkpatch.pl | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 45eb0ae..d162421 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1072,6 +1072,7 @@ sub process { our $clean = 1; my $signoff = 0; + my $headers = 0; my $is_patch = 0; our @report = (); @@ -1258,6 +1259,11 @@ sub process { $cnt_lines++ if ($realcnt != 0); + # Check for a RFC822 style header + if ($line =~ /^([a-z0-9-]+:|From )/i) { + $headers++; + } + #check the patch for a signoff: if ($line =~ /^\s*signed-off-by:/i) { # This is a signoff, if ugly, so do not double report. @@ -1270,6 +1276,14 @@ sub process { WARN("space required after Signed-off-by:\n" . $herecurr); } + + # There should be at least 1 line of ordinary + # text for the body of the commit log prior to + # the signoff. + if ($linenr - $headers < 2) { + print $headers . $linenr . "\n"; + WARN("no body for commit log"); + } } # Check for wrappage within a valid hunk of the file -- 1.5.6.3
| |