lkml.org 
[lkml]   [2019]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 2/2] scripts/spdxcheck.py: Handle special quotation mark comments
Date
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,
Sven[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-01-20 16:33    [W:0.111 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site