Re: [patch 2/2] scripts/spdxcheck.py: Handle special quotation mark comments
From: Sven Eckelmann
Date: Sun Jan 20 2019 - 10:33:13 EST
On Wednesday, 16 January 2019 11.26.53 CET Thomas Gleixner wrote:
> The SuperH boot code files use a magic format for the SPDX identifier
> comment:
>
> LIST "SPDX-License-Identifier: .... "
>
> The trailing quotation mark is not stripped before the token parser is
> invoked and causes the scan to fail. Handle it gracefully.
[...]
This patch introduces a false positive when checking files with an ANSI-C
style /* SPDX-License-Identifier: .... */ comment line.
$ ./scripts/checkpatch.pl -q -f include/linux/bug.h
WARNING: 'SPDX-License-Identifier: GPL-2.0 */' is not supported in LICENSES/...
#1: FILE: include/linux/bug.h:1:
+/* SPDX-License-Identifier: GPL-2.0 */
total: 0 errors, 1 warnings, 79 lines checked
checkpatch.pl is already stripping the "/* " prefix and only sends the
remaining "SPDX-License-Identifier: GPL-2.0 */" via stdin to
scripts/spdxcheck.py. Thus the newly introduced check
> + # Remove trailing comment closure
> + if line.startswith('/*'):
> + expr = expr.rstrip('*/').strip()
doesn't match and thus the code doesn't remove the " */" at the end of the
line.
Kind regards,
SvenAttachment:
signature.asc
Description: This is a digitally signed message part.