From: Philippe Schenker <dev@pschenker.ch>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Shawn Guo <shawnguo@kernel.org>,
Philippe Schenker <philippe.schenker@toradex.com>
Subject: [PATCH] checkpatch: add check for fixes: tag
Date: Wed, 7 Sep 2022 14:35:47 +0200 [thread overview]
Message-ID: <20220907123547.138646-1-dev@pschenker.ch> (raw)
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
next reply other threads:[~2022-09-07 12:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 12:35 Philippe Schenker [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220907123547.138646-1-dev@pschenker.ch \
--to=dev@pschenker.ch \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=philippe.schenker@toradex.com \
--cc=sfr@canb.auug.org.au \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®