Commit 490b292c authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: warn when a patch doesn't have a description

Potential patches should have a commit description.  Emit a warning when
there isn't one.

[akpm@linux-foundation.org: s/else if/elsif/]
Link: http://lkml.kernel.org/r/1b099f4d8373aa583a17011992676bf0f3f09eee.camel@perches.comSigned-off-by: default avatarJoe Perches <joe@perches.com>
Suggested-by: default avatarPrakruthi Deepak Heragu <pheragu@codeaurora.org>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 60f89010
...@@ -2253,6 +2253,7 @@ sub process { ...@@ -2253,6 +2253,7 @@ sub process {
my $in_header_lines = $file ? 0 : 1; my $in_header_lines = $file ? 0 : 1;
my $in_commit_log = 0; #Scanning lines before patch my $in_commit_log = 0; #Scanning lines before patch
my $has_commit_log = 0; #Encountered lines before patch my $has_commit_log = 0; #Encountered lines before patch
my $commit_log_lines = 0; #Number of commit log lines
my $commit_log_possible_stack_dump = 0; my $commit_log_possible_stack_dump = 0;
my $commit_log_long_line = 0; my $commit_log_long_line = 0;
my $commit_log_has_diff = 0; my $commit_log_has_diff = 0;
...@@ -2510,6 +2511,18 @@ sub process { ...@@ -2510,6 +2511,18 @@ sub process {
$cnt_lines++ if ($realcnt != 0); $cnt_lines++ if ($realcnt != 0);
# Verify the existence of a commit log if appropriate
# 2 is used because a $signature is counted in $commit_log_lines
if ($in_commit_log) {
if ($line !~ /^\s*$/) {
$commit_log_lines++; #could be a $signature
}
} elsif ($has_commit_log && $commit_log_lines < 2) {
WARN("COMMIT_MESSAGE",
"Missing commit description - Add an appropriate one\n");
$commit_log_lines = 2; #warn only once
}
# Check if the commit log has what seems like a diff which can confuse patch # Check if the commit log has what seems like a diff which can confuse patch
if ($in_commit_log && !$commit_log_has_diff && if ($in_commit_log && !$commit_log_has_diff &&
(($line =~ m@^\s+diff\b.*a/[\w/]+@ && (($line =~ m@^\s+diff\b.*a/[\w/]+@ &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment