From: Joe Perches <joe@perches.com>
To: Rob Herring <robh@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Andy Whitcroft <apw@canonical.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>
Subject: Re: [PATCH v4] checkpatch.pl: Add SPDX license tag check
Date: Thu, 21 Dec 2017 09:22:57 -0800 [thread overview]
Message-ID: <1513876977.4599.14.camel@perches.com> (raw)
In-Reply-To: <20171221170413.qca3vnif5f62rqsk@rob-hp-laptop>
On Thu, 2017-12-21 at 11:04 -0600, Rob Herring wrote:
> Okay, here's what I've ended up with:
>
> if ($realline == $checklicenseline) {
> if ($realfile =~ /\.(?:sh|pl|py)/ && $rawline =~ /\[ \+]\s*\!\#/) {
> $checklicenseline = 2;
> } elsif ($rawline =~ /^\+/) {
> my $comment = "";
> if ($realfile =~ /\.(h|s|S)$/) {
> $comment = '/\*';
> } elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
> $comment = '//';
> } elsif ($realfile =~ /\.(sh|pl|py)$/) {
> $comment = '#';
> } elsif ($realfile =~ /\.rst$/) {
> $comment = '\.\.';
> }
>
> if ($comment !~ /^$/ &&
> $rawline !~ m@^\+$comment SPDX-License-Identifier: @) {
> WARN("SPDX_LICENSE_TAG",
> "Missing or malformed SPDX-License-Identifier tag in 1st (or 2nd for scripts) line\n" .
> $herecurr);
> }
> }
> }
Seems sensible enough.
Maybe it's better to use \Q$comment\E and a consistent
style on comment and rawline
Any checkpatch patch for license style requirements should
not be applied until after Documentation/license-rules.rst
is in -next.
next prev parent reply other threads:[~2017-12-21 17:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 23:46 [PATCH v4] checkpatch.pl: Add SPDX license tag check Rob Herring
2017-12-21 6:28 ` Joe Perches
2017-12-21 17:04 ` Rob Herring
2017-12-21 17:22 ` Joe Perches [this message]
2017-12-21 7:15 ` Philippe Ombredanne
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=1513876977.4599.14.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
/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