From c879013472da4d19129a35b242ae23be28c2298e Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Thu, 28 Apr 2022 14:31:00 +0300 Subject: [PATCH] Add the type property for OptCheck to fix a pylint error Fix for kconfig_hardened_check/__init__.py:125:68: E1101: Instance of 'OptCheck' has no 'type' member (no-member) --- kconfig_hardened_check/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index a40d8f2..ce495ac 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -97,6 +97,10 @@ class OptCheck: self.state = None self.result = None + @property + def type(self): + return None + def check(self): # handle the option presence check if self.expected is None: @@ -715,6 +719,8 @@ def print_checklist(mode, checklist, with_results): def populate_simple_opt_with_data(opt, data, data_type): if opt.type == 'complex': sys.exit('[!] ERROR: unexpected ComplexOptCheck {}: {}'.format(opt.name, vars(opt))) + if opt.type not in TYPES_OF_CHECKS: + sys.exit('[!] ERROR: invalid opt type "{}" for {}'.format(opt.type, opt.name)) if data_type not in TYPES_OF_CHECKS: sys.exit('[!] ERROR: invalid data type "{}"'.format(data_type)) -- 2.31.1