[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b02899853247a2c67669561761f354dd3bd110e.camel@perches.com>
Date: Thu, 10 Jan 2019 16:05:11 -0800
From: Joe Perches <joe@...ches.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Andy Whitcroft <apw@...onical.com>
Cc: Rob Herring <robh@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] checkpatch: Verify SPDX comment style
Using SPDX commenting style // or /* is specified for
various file types in Documentation/process/license-rules.rst
so add an appropriate test for .[chsS] files because many
proposed file additions and patches do not use the correct style.
Signed-off-by: Joe Perches <joe@...ches.com>
---
scripts/checkpatch.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 155fa9305166..44c2a876be43 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3039,6 +3039,14 @@ sub process {
$comment = '..';
}
+# check SPDX comment style for .[chsS] files
+ if ($realfile =~ /\.[chsS]$/ &&
+ $rawline =~ /SPDX-License-Identifier:/ &&
+ $rawline !~ /^\+\s*\Q$comment\E\s*/) {
+ WARN("SPDX_LICENSE_TAG",
+ "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr);
+ }
+
if ($comment !~ /^$/ &&
$rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) {
WARN("SPDX_LICENSE_TAG",
Powered by blists - more mailing lists