qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] scripts/checkpatch.pl: check for placeholders in cover letter patches
@ 2024-01-30  7:56 Manos Pitsidianakis
  2024-01-30  8:12 ` Daniel P. Berrangé
  0 siblings, 1 reply; 7+ messages in thread
From: Manos Pitsidianakis @ 2024-01-30  7:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Philippe Mathieu-Daudé, Peter Maydell,
	Daniel P. Berrangé, Paolo Bonzini, Stefan Hajnoczi

Check if a file argument is a cover letter patch produced by
git-format-patch --cover-letter; It is initialized with subject suffix "
*** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***". If they
exist, warn the user.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 scripts/checkpatch.pl | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7026895074..34f12c9848 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1650,6 +1650,20 @@ sub process {
 			$non_utf8_charset = 1;
 		}
 
+# Check if this is a cover letter patch produced by git-format-patch
+# --cover-letter; It is initialized with subject suffix
+# " *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***"
+		if ($in_header_lines &&
+		    $rawline =~ /^Subject:.+[*]{3} SUBJECT HERE [*]{3}\s*$/) {
+        WARN("Patch appears to be a cover letter with uninitialized subject" .
+             " '*** SUBJECT HERE ***'\n$hereline\n");
+		}
+
+		if ($rawline =~ /^[*]{3} BLURB HERE [*]{3}\s*$/) {
+        WARN("Patch appears to be a cover letter with leftover placeholder " .
+             "text '*** BLURB HERE ***'\n$hereline\n");
+		}
+
 		if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ &&
 		    $rawline =~ /$NON_ASCII_UTF8/) {
 			WARN("8-bit UTF-8 used in possible commit log\n" . $herecurr);

base-commit: 11be70677c70fdccd452a3233653949b79e97908
-- 
γαῖα πυρί μιχθήτω



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

end of thread, other threads:[~2024-01-30 10:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30  7:56 [PATCH v1] scripts/checkpatch.pl: check for placeholders in cover letter patches Manos Pitsidianakis
2024-01-30  8:12 ` Daniel P. Berrangé
2024-01-30  8:51   ` Manos Pitsidianakis
2024-01-30  9:47     ` Daniel P. Berrangé
2024-01-30  9:54       ` Manos Pitsidianakis
2024-01-30  9:59         ` Daniel P. Berrangé
2024-01-30 10:17           ` Manos Pitsidianakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).