summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-03-19 10:38:23 +0100
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-03-23 13:15:32 -0700
commit2308c07b9d52b28f371388b9393b17508b2ddccd (patch)
treef209cac22a0cfd11063a799c65868d04ef4e89f5
parent889044594614756243259a22ed1448408a2b33ac (diff)
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 <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9940 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ira Cooper <ira@redhat.com> Reviewed-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rwxr-xr-xextras/checkpatch.pl11
1 files changed, 11 insertions, 0 deletions
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");