Commit fdf13693 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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.

Link: http://lkml.kernel.org/r/8b02899853247a2c67669561761f354dd3bd110e.camel@perches.comSigned-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 488cf833
...@@ -3037,6 +3037,14 @@ sub process { ...@@ -3037,6 +3037,14 @@ sub process {
$comment = '..'; $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 !~ /^$/ && if ($comment !~ /^$/ &&
$rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) { $rawline !~ /^\+\Q$comment\E SPDX-License-Identifier: /) {
WARN("SPDX_LICENSE_TAG", WARN("SPDX_LICENSE_TAG",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment