mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Verify SPDX comment style
@ 2019-01-11  0:05 Joe Perches
  2019-01-23 11:04 ` Joe Perches
  2019-02-05 22:21 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Joe Perches @ 2019-01-11  0:05 UTC (permalink / raw)
  To: Andrew Morton, Andy Whitcroft; +Cc: Rob Herring, LKML

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@perches.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",



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

end of thread, other threads:[~2019-02-06  2:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11  0:05 [PATCH] checkpatch: Verify SPDX comment style Joe Perches
2019-01-23 11:04 ` Joe Perches
2019-02-05 22:21 ` Andrew Morton
2019-02-06  2:21   ` Joe Perches

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®