Skip to contentSkip to conversation

checkpatch: warn on unhandled placeholders in cover letters

PATCH Superseded Onur Özkan 2 participants 4 messages Sep 17, 2025 Checkpatch

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: warn on unhandled placeholders in cover letters

Adds a new check to detect unhandled placeholders in cover letters. This prevents sending patch series with incomplete cover letters containing auto generated subject or blurb lines such as:

    *** SUBJECT HERE ***
    *** BLURB HERE ***

These placeholders can be seen on mailing lists (e.g., searching for "BLURB HERE" on lore.kernel.org). With this patch, checkpatch will emit a warning when such text is found.

Example output on an invalid cover letter:

WARNING: Incomplete cover letter: placeholder text detected #4: FILE: ./0000-cover-letter.patch:4:
+Subject: [PATCH 0/4] *** SUBJECT HERE ***

WARNING: Incomplete cover letter: placeholder text detected #9: FILE: ./0000-cover-letter.patch:9:
+*** BLURB HERE ***

total: 0 errors, 2 warnings, 24 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

./0000-cover-letter.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

---
 scripts/checkpatch.pl | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/checkpatch.pl +9 -0
index e722dd6fa8ef..9d5ded376112 100755
@@ -3339,6 +3339,15 @@ sub process {
 				$fixed[$fixlinenr] =~ s/^/ /;
 			}
 		}
+# Check for unhandled placeholder text in cover letters
+		if ($filename =~ /cover-letter\.patch$/) {
+			if ($rawline =~ /^\+Subject:.*\*\*\* SUBJECT HERE \*\*\*/ ||
+				$rawline =~ /^\+\*\*\* BLURB HERE \*\*\*/) {
+				my $placeholder = $1 || $2;
+				WARN("COVER_LETTER_PLACEHOLDER",
+					 "Incomplete cover letter: placeholder text detected\n" . $herecurr);
+			}
+		}
 
 # Check for git id commit length and improperly formed commit descriptions
 # A correctly formed commit description is:
Signature · 1 line
2.51.0
#1 lore raw
Quoted 59 lines · On Wed, 17 Sep 2025 14:49:09 +0300 Onur Özkan <[email protected]> wrote:

Adds a new check to detect unhandled placeholders in cover letters. This prevents sending patch series with incomplete cover letters containing auto generated subject or blurb lines such as:

    *** SUBJECT HERE ***
    *** BLURB HERE ***

These placeholders can be seen on mailing lists (e.g., searching for "BLURB HERE" on lore.kernel.org). With this patch, checkpatch will emit a warning when such text is found.

Example output on an invalid cover letter:

WARNING: Incomplete cover letter: placeholder text detected #4: FILE: ./0000-cover-letter.patch:4:
+Subject: [PATCH 0/4] *** SUBJECT HERE ***

WARNING: Incomplete cover letter: placeholder text detected #9: FILE: ./0000-cover-letter.patch:9:
+*** BLURB HERE ***

total: 0 errors, 2 warnings, 24 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.

./0000-cover-letter.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

---
 scripts/checkpatch.pl | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/checkpatch.pl +3 -0
index e722dd6fa8ef..9d5ded376112 100755
@@ -3339,6 +3339,15 @@ sub process {
 				$fixed[$fixlinenr] =~ s/^/ /;
 			}
 		}
+# Check for unhandled placeholder text in cover letters
+		if ($filename =~ /cover-letter\.patch$/) {
+			if ($rawline =~ /^\+Subject:.*\*\*\* SUBJECT

HERE \*\*\*/ ||

scripts/checkpatch.pl +1 -0
+				$rawline =~ /^\+\*\*\* BLURB HERE

\*\*\*/) {

scripts/checkpatch.pl +3 -0
+				my $placeholder = $1 || $2;
+				WARN("COVER_LETTER_PLACEHOLDER",
+					 "Incomplete cover letter:

placeholder text detected\n" . $herecurr);

scripts/checkpatch.pl +2 -0
+			}
+		}
 
 # Check for git id commit length and improperly formed commit
Quoted 1 line

descriptions # A correctly formed commit description is:

I wasn't aware of the checkpatch documentation in "Documentation/dev-tools/checkpatch.rst" file. I guess COVER_LETTER_PLACEHOLDER needs to be documented there?

Regards,
Onur

maintainer
#2 lore raw
Quoted 9 lines · Onur Özkan
Quoted 6 lines · On Wed, 17 Sep 2025 14:49:09 +0300 Onur Özkan <[email protected]> wrote:

Adds a new check to detect unhandled placeholders in cover letters. This prevents sending patch series with incomplete cover letters containing auto generated subject or blurb lines such as:

    *** SUBJECT HERE ***
    *** BLURB HERE ***

[]

Quoted 1 line

scripts/checkpatch.pl

Quoted 1 line
scripts/checkpatch.pl +0 -0

[]

Quoted 6 lines

scripts/checkpatch.pl sub process { · line 3343

Quoted 6 lines
scripts/checkpatch.pl +2 -0
@@ -3339,6 +3339,15 @@ sub process {
 				$fixed[$fixlinenr] =~ s/^/ /;
 			}
 		}
+# Check for unhandled placeholder text in cover letters
+		if ($filename =~ /cover-letter\.patch$/) {

Probably don't need this $filename test but do need some test and code like

		if (($in_commit_log || $in_header_lines) &&
		    $rawline =~ /(?:SUBJECT|BLURB) HERE/) {
			ERROR("PLACEHOLDER_USE",
			      "Placeholder text detected\n" . $herecurr);
		}
Quoted 5 lines

scripts/checkpatch.pl sub process { · line 3346

Quoted 5 lines
scripts/checkpatch.pl +1 -0
+			if ($rawline =~ /^\+Subject:.*\*\*\* SUBJECT

HERE \*\*\*/ ||

scripts/checkpatch.pl +1 -0
+				$rawline =~ /^\+\*\*\* BLURB HERE

\*\*\*/) {

scripts/checkpatch.pl +1 -0
+				my $placeholder = $1 || $2;

$placeholder isn't useful.

Quoted 1 line

scripts/checkpatch.pl sub process { · line 3347

Quoted 1 line
scripts/checkpatch.pl +1 -0
+				WARN("COVER_LETTER_PLACEHOLDER",

s/WARN/ERROR/

Quoted 4 lines

scripts/checkpatch.pl sub process { · line 3350

Quoted 4 lines
scripts/checkpatch.pl +1 -0
+					 "Incomplete cover letter:

placeholder text detected\n" . $herecurr);

scripts/checkpatch.pl +2 -0
+			}
+		}

[]

Quoted 3 lines

I wasn't aware of the checkpatch documentation in "Documentation/dev-tools/checkpatch.rst" file. I guess COVER_LETTER_PLACEHOLDER needs to be documented there?

yes.

#3 lore raw
Quoted 29 lines · On Wed, 17 Sep 2025 08:43:16 -0700 Joe Perches <[email protected]> wrote:
Quoted 9 lines · Onur Özkan
Quoted 6 lines · On Wed, 17 Sep 2025 14:49:09 +0300 Onur Özkan <[email protected]> wrote:

Adds a new check to detect unhandled placeholders in cover letters. This prevents sending patch series with incomplete cover letters containing auto generated subject or blurb lines such as:

    *** SUBJECT HERE ***
    *** BLURB HERE ***

[]

Quoted 1 line

scripts/checkpatch.pl

Quoted 1 line
scripts/checkpatch.pl +0 -0

[]

Quoted 6 lines

scripts/checkpatch.pl sub process { · line 3343

Quoted 6 lines
scripts/checkpatch.pl +2 -0
@@ -3339,6 +3339,15 @@ sub process {
 				$fixed[$fixlinenr] =~ s/^/ /;
 			}
 		}
+# Check for unhandled placeholder text in cover letters
+		if ($filename =~ /cover-letter\.patch$/) {

Probably don't need this $filename test but do need some test and code like

		if (($in_commit_log || $in_header_lines) &&
		    $rawline =~ /(?:SUBJECT|BLURB) HERE/) {
			ERROR("PLACEHOLDER_USE",
			      "Placeholder text detected\n" .

$herecurr); }

Quoted 8 lines
Quoted 5 lines

scripts/checkpatch.pl sub process { · line 3346

Quoted 5 lines
scripts/checkpatch.pl +1 -0
+			if ($rawline =~ /^\+Subject:.*\*\*\*

SUBJECT HERE \*\*\*/ ||

scripts/checkpatch.pl +1 -0
+				$rawline =~ /^\+\*\*\* BLURB HERE

\*\*\*/) {

scripts/checkpatch.pl +1 -0
+				my $placeholder = $1 || $2;

$placeholder isn't useful.

That was a left-over, sorry.

Quoted 14 lines
Quoted 1 line

scripts/checkpatch.pl sub process { · line 3347

Quoted 1 line
scripts/checkpatch.pl +1 -0
+				WARN("COVER_LETTER_PLACEHOLDER",

s/WARN/ERROR/

Quoted 4 lines

scripts/checkpatch.pl sub process { · line 3350

Quoted 4 lines
scripts/checkpatch.pl +1 -0
+					 "Incomplete cover

letter: placeholder text detected\n" . $herecurr);

scripts/checkpatch.pl +2 -0
+			}
+		}

[]

Quoted 3 lines

I wasn't aware of the checkpatch documentation in "Documentation/dev-tools/checkpatch.rst" file. I guess COVER_LETTER_PLACEHOLDER needs to be documented there?

yes.