From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 3/3] scripts: forbid use of arbitrary SPDX tags besides license identifiers
Date: Fri, 28 Feb 2025 15:44:50 +0000 [thread overview]
Message-ID: <20250228154450.3185564-4-berrange@redhat.com> (raw)
In-Reply-To: <20250228154450.3185564-1-berrange@redhat.com>
While SPDX-License-Identifier is a well known SPDX tag, there are a
great many more besides that[1]. These are mostly focused on making
machine readable metadata available to the 'reuse' tool and similar.
They cover concepts like author names, copyright owners, and much
more. It is even possible to define source file line groups and apply
different SPDX tags to regions of code within a file.
At this time we're only interested in adopting SPDX for recording the
file global licensing info, so detect & reject any other SPDX metadata.
If we want to explicitly collect extra data in SPDX format, we can
evaluate each data item on its merits when someone wants to propose it
at a later date.
[1] https://spdx.github.io/spdx-spec/v2.2.2/file-tags/
https://spdx.github.io/spdx-spec/v2.2.2/file-information/
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
scripts/checkpatch.pl | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8995d2c391..83b59fb443 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1714,6 +1714,18 @@ sub process {
&checkspdx($realfile, $1);
}
+ if ($rawline =~ m,(SPDX-[a-zA-Z0-9-_]+):,) {
+ my $tag = $1;
+ my @permitted = qw(
+ SPDX-License-Identifier
+ );
+
+ unless (grep { /^$tag$/ } @permitted) {
+ ERROR("Tag $tag not permitted in QEMU code, valid " .
+ "choices are: " . join(", ", @permitted));
+ }
+ }
+
# Check for wrappage within a valid hunk of the file
if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
ERROR("patch seems to be corrupt (line wrapped?)\n" .
--
2.48.1
next prev parent reply other threads:[~2025-02-28 15:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 15:44 [PULL 0/3] SPDX checkpatch Daniel P. Berrangé
2025-02-28 15:44 ` [PULL 1/3] scripts: mandate that new files have SPDX-License-Identifier Daniel P. Berrangé
2025-05-08 10:42 ` Peter Maydell
2025-05-12 13:52 ` Cédric Le Goater
2025-05-12 15:18 ` Cédric Le Goater
2025-05-12 15:28 ` Peter Maydell
2025-05-12 15:36 ` Cédric Le Goater
2025-02-28 15:44 ` [PULL 2/3] scripts: validate SPDX license choices Daniel P. Berrangé
2025-02-28 15:44 ` Daniel P. Berrangé [this message]
2025-03-03 12:12 ` [PULL 0/3] SPDX checkpatch Stefan Hajnoczi
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=20250228154450.3185564-4-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).