From: "Ignacio Peña" <ignacio.pena87@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: [PATCH v4] checkpatch: warn about novice phrases in commit messages
Date: Tue, 29 Jul 2025 10:07:25 -0400 [thread overview]
Message-ID: <20250729140725.130842-1-ignacio.pena87@gmail.com> (raw)
In-Reply-To: <ZqCu6xskqgLMQm8K@saruman>
Add warnings for common phrases that indicate uncertainty or lack of
confidence in commit messages.
Signed-off-by: Ignacio Peña <ignacio.pena87@gmail.com>
---
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
next parent reply other threads:[~2025-07-29 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ZqCu6xskqgLMQm8K@saruman>
2025-07-29 14:07 ` Ignacio Peña [this message]
2025-07-29 20:28 ` [PATCH v4] checkpatch: warn about novice phrases in commit messages Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250729140725.130842-1-ignacio.pena87@gmail.com \
--to=ignacio.pena87@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox