From: Alexander Popov Date: Mon, 14 Aug 2023 13:02:21 +0000 (+0300) Subject: Turn the warning about unexpected line in Kconfig file into an error X-Git-Tag: v0.6.6~93 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;ds=sidebyside;h=133e7a078a0018e376dc52902e6a8ed66c8849a4;p=kconfig-hardened-check.git Turn the warning about unexpected line in Kconfig file into an error --- diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index ee0babe..d7df1bf 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -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')