[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250723030257.66560-1-ignacio.pena87@gmail.com>
Date: Tue, 22 Jul 2025 23:02:56 -0400
From: Ignacio Peña <ignacio.pena87@...il.com>
To: Joe Perches <joe@...ches.com>,
Andy Whitcroft <apw@...onical.com>
Cc: Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/2] checkpatch: warn about novice phrases in commit messages
Add detection for common phrases that make patches appear less
confident. A single regex efficiently matches multiple patterns:
- 'please apply/merge/consider/review'
- 'hope this helps'
- 'my first patch/contribution'
- 'newbie/beginner here'
- 'not sure if (this is) correct'
- 'sorry if/for'
This check helps newcomers learn kernel communication style,
reducing patches dismissed for presentation rather than merit.
Link: https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
Suggested-by: Joe Perches <joe@...ches.com>
Signed-off-by: Ignacio Peña <ignacio.pena87@...il.com>
---
scripts/checkpatch.pl | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e722dd6fa..6953ad515 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3266,6 +3266,15 @@ sub process {
"A patch subject line should describe the change not the tool that found it\n" . $herecurr);
}
+
+# Check for novice phrases in commit message
+ if ($in_commit_log && !$non_utf8_charset) {
+ # Single regex with all phrases, using non-capturing groups as Joe suggested
+ if ($line =~ /\b(?:please\s+(?:apply|merge|consider|review)|hope\s+this\s+helps|my\s+first\s+(?:patch|contribution)|(?:newbie|beginner)\s+here|not\s+sure\s+if\s+(?:this\s+is\s+)?correct|sorry\s+(?:if|for))\b/i) {
+ WARN("COMMIT_MESSAGE_NOVICE",
+ "Avoid apologetic or uncertain language - be direct and confident\n" . $herecurr);
+ }
+ }
# Check for Gerrit Change-Ids not in any patch context
if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
if (ERROR("GERRIT_CHANGE_ID",
--
2.50.1
Powered by blists - more mailing lists