public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Warn on empty commit log bodies
@ 2009-02-27 18:05 Mark Brown
  2009-02-28 13:58 ` Stefan Richter
  2009-02-28 17:40 ` Arjan van de Ven
  0 siblings, 2 replies; 26+ messages in thread
From: Mark Brown @ 2009-02-27 18:05 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: linux-kernel, Mark Brown

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


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2009-03-10 18:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-27 18:05 [PATCH] checkpatch: Warn on empty commit log bodies Mark Brown
2009-02-28 13:58 ` Stefan Richter
2009-02-28 15:58   ` Mark Brown
2009-02-28 16:14     ` Stefan Richter
2009-02-28 16:46       ` Mark Brown
2009-02-28 17:33         ` Stefan Richter
2009-02-28 17:52           ` Mark Brown
2009-02-28 19:25             ` Stefan Richter
2009-02-28 21:02               ` Mark Brown
2009-02-28 23:01                 ` Stefan Richter
2009-03-01  0:18                   ` Theodore Tso
2009-03-01  0:46                     ` Mark Brown
2009-03-01  2:53                       ` Theodore Tso
2009-03-02 13:15                         ` Mark Brown
2009-03-02 15:15                           ` Stefan Richter
2009-03-02 16:01                             ` Mark Brown
2009-03-02 18:01                             ` Andrew Morton
2009-03-02 18:24                               ` Mark Brown
2009-03-02 18:34                                 ` Andrew Morton
2009-03-02 18:43                                   ` Theodore Tso
2009-03-02 19:19                                   ` Mark Brown
2009-03-02 19:57                                     ` Theodore Tso
2009-03-02 20:38                                       ` Mark Brown
2009-03-10 18:19                     ` Andy Whitcroft
2009-02-28 17:40 ` Arjan van de Ven
2009-02-28 17:47   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox