The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4] checkpatch: warn about novice phrases in commit messages
       [not found] <ZqCu6xskqgLMQm8K@saruman>
@ 2025-07-29 14:07 ` Ignacio Peña
  2025-07-29 20:28   ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Ignacio Peña @ 2025-07-29 14:07 UTC (permalink / raw)
  To: Joe Perches; +Cc: Andrew Morton, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4] checkpatch: warn about novice phrases in commit messages
  2025-07-29 14:07 ` [PATCH v4] checkpatch: warn about novice phrases in commit messages Ignacio Peña
@ 2025-07-29 20:28   ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2025-07-29 20:28 UTC (permalink / raw)
  To: Ignacio Peña; +Cc: Andrew Morton, linux-kernel

On Tue, 2025-07-29 at 10:07 -0400, Ignacio Peña wrote:
> 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(+)

-ENOCHANGELOG

> diff --git 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

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.

> +			)(?:\s|$)}x;
> +			if ($line =~ /$novice_phrases/) {

this should be
			if ($line =~ /\b$novice_phrases\b/) {

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-29 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <ZqCu6xskqgLMQm8K@saruman>
2025-07-29 14:07 ` [PATCH v4] checkpatch: warn about novice phrases in commit messages Ignacio Peña
2025-07-29 20:28   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox