Skip to contentSkip to conversation

checkpatch: warn about novice phrases in commit messages

PATCH In review Ignacio Peña 2 participants 2 messages Jul 29, 2025 1 message not in the archive Checkpatch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): ZqCu6xskqgLMQm8K@saruman

#1 lore raw

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.

---
 scripts/checkpatch.pl | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
scripts/checkpatch.pl +18 -0
index ac270f35b..f79a525a7 100755
@@ -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
maintainer
#2 lore raw
Quoted 7 lines · Ignacio Peña

Add warnings for common phrases that indicate uncertainty or lack of confidence in commit messages.

---
 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*$/ ||