Add more ComplexOptCheck validation
authorAlexander Popov <alex.popov@linux.com>
Mon, 14 Feb 2022 16:50:21 +0000 (19:50 +0300)
committerAlexander Popov <alex.popov@linux.com>
Mon, 14 Feb 2022 22:03:00 +0000 (01:03 +0300)
kconfig_hardened_check/__init__.py

index 12edc9f9d3c06e617261ef4537f2edd95d0ebd54..d69dded085a9d55763e693fe540c59be0f892a47 100644 (file)
@@ -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