From 2308c07b9d52b28f371388b9393b17508b2ddccd Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 19 Mar 2015 10:38:23 +0100 Subject: build: let checkpatch check for a trailing dot The subject of a patch should not end with a dot (.). It is not common to have subjects of emails end with a dot, and neither is it common for patches. Change-Id: Id090241393aee3ca99df4887bdb2d7a7a8913164 BUG: 1198849 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/9940 Tested-by: Gluster Build System Reviewed-by: Ira Cooper Reviewed-by: Lalatendu Mohanty Reviewed-by: Kaleb KEITHLEY --- extras/checkpatch.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extras/checkpatch.pl b/extras/checkpatch.pl index 00cb5a6ef39..7402e2a6556 100755 --- a/extras/checkpatch.pl +++ b/extras/checkpatch.pl @@ -1667,6 +1667,7 @@ sub process { our $clean = 1; my $signoff = 0; + my $subject_trailing_dot = 0; my $is_patch = 0; my $in_header_lines = 1; @@ -1899,6 +1900,12 @@ sub process { next if ($realfile =~ /(checkpatch.pl)/); next if ($realfile =~ /\.(md|txt|doc|8|pdf|tex)$/); +# Check that the subject does not have a trailing dot + if ($in_header_lines && + $line =~ /^Subject: \[PATCH\] (.+)\.(\s*)$/) { + $subject_trailing_dot++; + } + # Check the patch for a signoff: if ($line =~ /^\s*signed-off-by:/i) { $signoff++; @@ -4233,6 +4240,10 @@ sub process { ERROR("NOT_UNIFIED_DIFF", "Does not appear to be a unified-diff format patch\n"); } + if ($is_patch && $subject_trailing_dot != 0) { + ERROR("SUBJECT_TRAILING_DOT", + "The subject of the patch should not end with a dot.\n"); + } if ($is_patch && $chk_signoff && $signoff == 0) { ERROR("MISSING_SIGN_OFF", "Missing Signed-off-by: line(s)\n"); -- cgit