* [PATCH] scripts/spdxcheck: Parse j2 comments correctly
@ 2024-11-29 10:37 Thomas Gleixner
0 siblings, 0 replies; only message in thread
From: Thomas Gleixner @ 2024-11-29 10:37 UTC (permalink / raw)
To: LKML; +Cc: Greg Kroah-Hartman
j2 files use '#}' as comment closure, which trips up the SPDX
parser:
tools/.../definition.j2: 1:36 Invalid token: #}
Handle those comments correctly by removing the closure.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
scripts/spdxcheck.py | 3 +++
1 file changed, 3 insertions(+)
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -217,6 +217,9 @@ import os
# Special case for SH magic boot code files
if line.startswith('LIST \"'):
expr = expr.rstrip('\"').strip()
+ # Remove j2 comment closure
+ if line.startswith('{#'):
+ expr = expr.rstrip('#}').strip()
self.parse(expr)
self.spdx_valid += 1
#
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-29 10:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-29 10:37 [PATCH] scripts/spdxcheck: Parse j2 comments correctly Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox