checkpatch: warn about novice phrases in commit messages
A message that is not in the archive (sent off-list or not yet received): ZqCu6xskqgLMQm8K@saruman
PATCH v4 1/1 checkpatch: warn about novice phrases in commit messages
Add warnings for common phrases that indicate uncertainty or lack of confidence in commit messages.
Signed-off-by Ignacio Peña <[email protected]>
--- scripts/checkpatch.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
scripts/checkpatch.pl +18 -0
@@ -3430,6 +3430,24 @@ sub process { "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr); } +# Check for novice phrases in commit messages + if ($in_commit_log && !$non_utf8_charset) { + my $novice_phrases = qr{(?:^|\s)(?i)( + I\s+think| + I\s+believe| + I\s+suppose| + probably| + maybe| + perhaps| + possibly| + hopefully + )(?:\s|$)}x; + if ($line =~ /$novice_phrases/) { + WARN("NOVICE_PHRASE", + "Avoid uncertainty phrases like '$1' in commit messages\n" . $herecurr); + } + } + # Check for added, moved or deleted files if (!$reported_maintainer_file && !$in_commit_log && ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
Signature · 1 line
2.50.1
Joe Perches
maintainerQuoted 7 lines · Ignacio Peña
Add warnings for common phrases that indicate uncertainty or lack of confidence in commit messages.
Signed-off-by Ignacio Peña <[email protected]>--- scripts/checkpatch.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
-ENOCHANGELOG
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0
[]
Quoted 5 lines
scripts/checkpatch.pl +1
-0@@ -3430,6 +3430,24 @@ sub process { "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr); } +# Check for novice phrases in commit messages
scripts/checkpatch.pl sub process { · line 3443
Quoted 10 lines
scripts/checkpatch.pl +10
-0+ if ($in_commit_log && !$non_utf8_charset) { + my $novice_phrases = qr{(?:^|\s)(?i)( + I\s+think| + I\s+believe| + I\s+suppose| + probably| + maybe| + perhaps| + possibly| + hopefully
definite nak.
maybe is used way too often.
Where did you get these word choices?
What happened to the "my first kernel patch" phrases?
And you have not ever answered why !$non_utf8_charset is useful.
scripts/checkpatch.pl sub process { · line 3445
Quoted 2 lines
scripts/checkpatch.pl +2
-0+ )(?:\s|$)}x; + if ($line =~ /$novice_phrases/) {
this should be
if ($line =~ /\b$novice_phrases\b/) {Quoted 8 lines
scripts/checkpatch.pl +5
-0+ WARN("NOVICE_PHRASE", + "Avoid uncertainty phrases like '$1' in commit messages\n" . $herecurr); + } + } + # Check for added, moved or deleted files if (!$reported_maintainer_file && !$in_commit_log && ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||