Skip to contentSkip to conversation

checkpatch: add new check PLACEHOLDER_USE

PATCH Applied Onur Özkan 2 participants 5 messages Sep 17, 2025 – Oct 9, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover checkpatch: add new check PLACEHOLDER_USE

Changes in v2:
- The check is documented in Documentation/dev-tools/checkpatch.rst file.
- Used ERROR instead of WARN on detection.

Onur Özkan (2):
checkpatch: detect unhandled placeholders in cover letters
checkpatch: document new check PLACEHOLDER_USE

 Documentation/dev-tools/checkpatch.rst | 10 ++++++++++
 scripts/checkpatch.pl                  |  7 +++++++
 2 files changed, 17 insertions(+)
Signature · 1 line
2.51.0
#1 lore raw

PATCH v2 1/2 checkpatch: detect unhandled placeholders in cover letters

Adds a new check PLACEHOLDER_USE to detect unhandled placeholders. This prevents sending patch series with incomplete patches (mostly in cover letters) containing auto generated subject or blurb lines.

These placeholders can be seen on mailing lists. With this change, checkpatch will emit an error when such text is found.

---
 scripts/checkpatch.pl | 7 +++++++
 1 file changed, 7 insertions(+)
scripts/checkpatch.pl +7 -0
index e722dd6fa8ef..965faee71935 100755
@@ -3340,6 +3340,13 @@ sub process {
 			}
 		}
 
+# Check for auto-generated unhandled placeholder text (mostly for cover letters)
+		if (($in_commit_log || $in_header_lines) &&
+		    $rawline =~ /(?:SUBJECT|BLURB) HERE/) {
+			ERROR("PLACEHOLDER_USE",
+			      "Placeholder text detected\n" . $herecurr);
+		}
+
 # Check for git id commit length and improperly formed commit descriptions
 # A correctly formed commit description is:
 #    commit <SHA-1 hash length 12+ chars> ("Complete commit subject")
Signature · 1 line
2.51.0
#2 lore raw

PATCH v2 2/2 checkpatch: document new check PLACEHOLDER_USE

In reply to Onur Özkan

Adds documentation for the new check PLACEHOLDER_USE in checkpatch.

---
 Documentation/dev-tools/checkpatch.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/dev-tools/checkpatch.rst +10 -0
index d5c47e560324..4dccd1036870 100644
@@ -1245,6 +1245,16 @@ Others
     The patch file does not appear to be in unified-diff format.  Please
     regenerate the patch file before sending it to the maintainer.
 
+  **PLACEHOLDER_USE**
+    Detects unhandled placeholder text left in cover letters or commit headers/logs.
+    Common placeholders include lines like::
+
+      *** SUBJECT HERE ***
+      *** BLURB HERE ***
+
+    These typically come from autogenerated templates. Replace them with a proper
+    subject and description before sending.
+
   **PRINTF_0XDECIMAL**
     Prefixing 0x with decimal output is defective and should be corrected.
 
Signature · 1 line
2.51.0
#3 lore raw
In reply to Onur Özkan
Quoted 5 lines · On Wed, 17 Sep 2025 20:37:23 +0300 Onur Özkan <[email protected]> wrote:

Changes in v2:
- The check is documented in Documentation/dev-tools/checkpatch.rst
file.
- Used ERROR instead of WARN on detection.

Quoted 8 lines

Onur Özkan (2):
checkpatch: detect unhandled placeholders in cover letters
checkpatch: document new check PLACEHOLDER_USE

 Documentation/dev-tools/checkpatch.rst | 10 ++++++++++
 scripts/checkpatch.pl                  |  7 +++++++
 2 files changed, 17 insertions(+)

A friendly ping on this patch. It's been over two weeks with no feedback, would appreciate any thoughts or suggestions.

Regards,
Onur

maintainer Acked-by on the v2 series
#4 lore raw
In reply to Onur Özkan
Quoted 11 lines · Onur Özkan

Changes in v2:
- The check is documented in Documentation/dev-tools/checkpatch.rst file.
- Used ERROR instead of WARN on detection.

Onur Özkan (2):
checkpatch: detect unhandled placeholders in cover letters
checkpatch: document new check PLACEHOLDER_USE

 Documentation/dev-tools/checkpatch.rst | 10 ++++++++++
 scripts/checkpatch.pl                  |  7 +++++++
 2 files changed, 17 insertions(+)