[PATCH v4] checkpatch: warn about novice phrases in commit messages

From: Ignacio Peña
Date: Tue Jul 29 2025 - 10:07:33 EST


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

Signed-off-by: Ignacio Peña <ignacio.pena87@xxxxxxxxx>
---
scripts/checkpatch.pl | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ac270f35b..f79a525a7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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*$/ ||
--
2.50.1