From: Alexander Popov Date: Mon, 14 Feb 2022 16:50:21 +0000 (+0300) Subject: Add more ComplexOptCheck validation X-Git-Tag: v0.5.17~30^2~5 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=d0b694203778b518ef3c98267aae5b4eaa9d6dfa;p=kconfig-hardened-check.git Add more ComplexOptCheck validation --- diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 12edc9f..d69dded 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -175,6 +175,8 @@ class ComplexOptCheck: self.opts = opts if not self.opts: sys.exit('[!] ERROR: empty {} check'.format(self.__class__.__name__)) + if len(self.opts) == 1: + sys.exit('[!] ERROR: useless {} check'.format(self.__class__.__name__)) if not isinstance(opts[0], KconfigCheck): sys.exit('[!] ERROR: invalid {} check: {}'.format(self.__class__.__name__, opts)) self.result = None