From: Alexander Popov Date: Thu, 28 Apr 2022 11:31:00 +0000 (+0300) Subject: Add the type property for OptCheck to fix a pylint error X-Git-Tag: v0.5.17~2 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=c879013472da4d19129a35b242ae23be28c2298e;p=kconfig-hardened-check.git 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) --- 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))