From: Thomas Gleixner Date: Fri, 29 Nov 2024 10:37:45 +0000 (+0100) Subject: scripts/spdxcheck: Parse j2 comments correctly X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=634d34e856ca0123f96613ffaf1852a1d3b46880;p=users%2Fjedix%2Flinux-maple.git scripts/spdxcheck: Parse j2 comments correctly 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 Link: https://lore.kernel.org/r/878qt2xr46.ffs@tglx Signed-off-by: Greg Kroah-Hartman --- diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index 8b8fb115fc819..fe57c9aecf37d 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py @@ -217,6 +217,9 @@ class id_parser(object): # 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 #