mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Ignacio Peña" <ignacio.pena87@gmail.com>,
	"Andy Whitcroft" <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] checkpatch: warn about novice phrases in commit messages
Date: Thu, 24 Jul 2025 00:04:07 -0700	[thread overview]
Message-ID: <7d938f5514c8e4705cab01e776648fd2b6be0edd.camel@perches.com> (raw)
In-Reply-To: <20250724032842.69739-1-ignacio.pena87@gmail.com>

On Wed, 2025-07-23 at 23:28 -0400, Ignacio Peña wrote:
> Add detection for common phrases that make patches appear less
> confident. These phrases are often used by newcomers and can make
> their contributions seem less professional or uncertain.
> 
> The regex uses qr{} syntax as suggested for better readability and
> potential pre-compilation benefits.

Unneessary paragraph.

> 
> Examples of detected phrases:
> - '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 helps newcomers learn the expected communication style in
> kernel development, where direct and confident communication is
> preferred.
> 
> Link: https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
> Suggested-by: Joe Perches <joe@perches.com>

I did not suggest this.
I am merely trying to improve the patch and its readability.
I do not need to have any credit for this.

> Signed-off-by: Ignacio Peña <ignacio.pena87@gmail.com>
> ---
> Changes in v3:
> - Use qr{} syntax instead of // for the regex (Joe Perches)
> - Remove comment about the suggestion (Joe Perches)
> - Drop the SHA enforcement patch based on maintainer feedback

This last line should be part of a cover letter to the patch set
rather than added to this specific patch.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3266,6 +3266,14 @@ 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) {

You still haven't answered why $!non_utf8_charset is useful.

> +			if ($line =~ qr{\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) {

And this is still not human readable.
I much prefer describing each phrase on a separate line like:

			my $novice_phrases = qr{(?xi:
				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)
			)};

			if ($line =~ /\b$novice_phrase\b/) {


      reply	other threads:[~2025-07-24  7:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 16:24 [PATCH 1/3] " Ignacio Peña
2025-07-21 16:24 ` [PATCH 2/3] checkpatch: enforce 12-char SHA for Fixes tags Ignacio Peña
2025-07-22  8:00   ` Greg Kroah-Hartman
2025-07-21 16:24 ` [PATCH 3/3] checkpatch: suggest including testing evidence Ignacio Peña
2025-07-22  7:59   ` Greg Kroah-Hartman
2025-07-22 17:58 ` [PATCH 1/3] checkpatch: warn about novice phrases in commit messages Joe Perches
2025-07-23  3:02 ` [PATCH v2 1/2] " Ignacio Peña
2025-07-23  3:02   ` [PATCH v2 2/2] checkpatch: enforce 12-char SHA for Fixes tags Ignacio Peña
2025-07-23  5:18     ` Greg Kroah-Hartman
2025-07-23  3:26   ` [PATCH v2 1/2] checkpatch: warn about novice phrases in commit messages Joe Perches
2025-07-24  3:28   ` [PATCH v3] " Ignacio Peña
2025-07-24  7:04     ` Joe Perches [this message]

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=7d938f5514c8e4705cab01e776648fd2b6be0edd.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=ignacio.pena87@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    /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

all inboxes | Powered by JetHome®