Commit fc387a07 authored by Onur Özkan's avatar Onur Özkan Committed by Andrew Morton
Browse files

checkpatch: detect unhandled placeholders in cover letters

Add 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.

Link: https://lkml.kernel.org/r/20250917173725.22547-2-work@onurozkan.dev


Signed-off-by: default avatarOnur Özkan <work@onurozkan.dev>
Acked-by: default avatarJoe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 969493d7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3345,6 +3345,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")