mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: add check for fixes: tag
@ 2022-09-07 12:35 Philippe Schenker
  2022-09-07 15:18 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Schenker @ 2022-09-07 12:35 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, linux-kernel
  Cc: Stephen Rothwell, Dwaipayan Ray, Lukas Bulwahn, Shawn Guo,
	Philippe Schenker

From: Philippe Schenker <philippe.schenker@toradex.com>

The page about submitting patches in
Documentation/process/submitting-patches.rst is very specific on how that
tag should be formatted: 'Fixes: <12+ chars of sha1> (\"<title line>\")'

Add a rule that warns if this format does not match. This commit is
introduced as in the past commits have been sent multiple times with
having the word commit also in the Fixes: tag which had to be corrected
by the maintainers. [1]

[1] https://lore.kernel.org/all/20220906073746.1f2713f7@canb.auug.org.au/
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

---

 scripts/checkpatch.pl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 79e759aac543..0d7ce0c3801a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3438,6 +3438,13 @@ sub process {
 			}
 		}
 
+# Check fixes tag format
+		if ($in_commit_log && ($line =~ /^\s*Fixes:/i) &&
+			!($line =~ /^\s*Fixes:\s[0-9a-f]{12,40}\s\(\".*\"\)/)) {
+			WARN("FIXES_TAG_FORMAT",
+			     "Possible wrong format on Fixes: tag, please use format Fixes: <12+ chars of sha1> (\"<title line>\")\n" . $herecurr);
+		}
+
 # ignore non-hunk lines and lines being removed
 		next if (!$hunk_line || $line =~ /^-/);
 
-- 
2.37.2


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

end of thread, other threads:[~2022-09-08 14:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 12:35 [PATCH] checkpatch: add check for fixes: tag Philippe Schenker
2022-09-07 15:18 ` Joe Perches
2022-09-07 23:01   ` Stephen Rothwell
2022-09-08 10:01   ` Philippe Schenker
2022-09-08 14:41     ` niklas.soderlund

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®