Commit 634d34e8 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Greg Kroah-Hartman
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/878qt2xr46.ffs@tglx


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c301e1fe
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
                #