Turn the warning about unexpected line in Kconfig file into an error
authorAlexander Popov <alex.popov@linux.com>
Mon, 14 Aug 2023 13:02:21 +0000 (16:02 +0300)
committerAlexander Popov <alex.popov@linux.com>
Mon, 14 Aug 2023 13:02:21 +0000 (16:02 +0300)
kconfig_hardened_check/__init__.py

index ee0babe223e0cc3977b2ac1ee29a1ce011fb32a8..d7df1bf58908a3c1818700cc266b67aa322a162a 100644 (file)
@@ -168,8 +168,8 @@ def parse_kconfig_file(mode, parsed_options, fname):
                 option, value = line[2:].split(' ', 1)
                 assert(value == 'is not set'), \
                        f'unexpected value of disabled Kconfig option "{line}"'
-            elif line != '' and not line.startswith('#') and mode != 'json':
-                print(f'[!] WARNING: strange line in Kconfig file: "{line}"')
+            elif line != '' and not line.startswith('#'):
+                sys.exit(f'[!] ERROR: unexpected line in Kconfig file: "{line}"')
 
             if option in parsed_options:
                 sys.exit(f'[!] ERROR: Kconfig option "{line}" is found multiple times')