summaryrefslogtreecommitdiff
path: root/scripts/spdxcheck.py
diff options
context:
space:
mode:
authorAurélien Cedeyn <aurelien.cedeyn@gmail.com>2019-02-21 00:18:34 +0300
committerJonathan Corbet <corbet@lwn.net>2019-02-22 18:47:05 +0300
commita5f4cb4288e548ab415bbfebd1105c7b29ba9f8c (patch)
tree76c738f34139f35213b3129fff1cc81d6df7ced7 /scripts/spdxcheck.py
parent61ab9fecaf4fb829d21bbc3ec6679b1505fd61e8 (diff)
downloadlinux-a5f4cb4288e548ab415bbfebd1105c7b29ba9f8c.tar.xz
scripts/spdxcheck.py: fix C++ comment style detection
With the last commit to support the SuperH boot code files, we have the following regression: $ ./scripts/checkpatch.pl -f <(echo '/* SPDX-License-Identifier: MIT */') WARNING: 'SPDX-License-Identifier: MIT */' is not supported in LICENSES/.. +/* SPDX-License-Identifier: MIT */ total: 0 errors, 1 warnings, 1 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /dev/fd/63 has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. This is not obvious, but spdxcheck.py is launched in checkpatch.pl with : ... } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { my $spdx_license = $1; if (!is_SPDX_License_valid($spdx_license)) { WARN("SPDX_LICENSE_TAG", "'$spdx_license' is not supported in LICENSES/...\n" . \ $herecurr); } ... sub is_SPDX_License_valid { my ($license) = @_; ... my $status = `cd "$root_path"; echo "$license" | python scripts/spdxcheck.py -`; ... } The first chars before 'SPDX-License-Identifier:' are ignored. This commit fixes this regression. Fixes:959b49687838 (scripts/spdxcheck.py: Handle special quotation mark comments) Signed-off-by:Aurélien Cedeyn <aurelien.cedeyn@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/spdxcheck.py')
-rwxr-xr-xscripts/spdxcheck.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
index 3fb020c2cb7f..4fe392e507fb 100755
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -177,7 +177,7 @@ class id_parser(object):
continue
expr = line.split(':')[1].strip()
# Remove trailing comment closure
- if line.startswith('/*'):
+ if line.strip().endswith('*/'):
expr = expr.rstrip('*/').strip()
# Special case for SH magic boot code files
if line.startswith('LIST \"'):