X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=kconfig_hardened_check%2Fengine.py;h=2e86ef307f1eea244fa593dc5899f095b578c35b;hb=316599f95c538278967ccecbcb4b6b10540ec6a2;hp=8f3191bd75182caeb390c14f30e78edd1645d9e7;hpb=d50ea2d47ac885b332ae31923558b90e412428b3;p=kconfig-hardened-check.git diff --git a/kconfig_hardened_check/engine.py b/kconfig_hardened_check/engine.py index 8f3191b..2e86ef3 100644 --- a/kconfig_hardened_check/engine.py +++ b/kconfig_hardened_check/engine.py @@ -269,17 +269,16 @@ def populate_simple_opt_with_data(opt, data, data_type): def populate_opt_with_data(opt, data, data_type): - if opt.type == 'complex': + assert(opt.type != 'version'), 'a single VersionCheck is useless' + if opt.type != 'complex': + populate_simple_opt_with_data(opt, data, data_type) + else: for o in opt.opts: - if o.type == 'complex': + if o.type != 'complex': + populate_simple_opt_with_data(o, data, data_type) + else: # Recursion for nested ComplexOptCheck objects populate_opt_with_data(o, data, data_type) - else: - populate_simple_opt_with_data(o, data, data_type) - else: - assert(opt.type != 'version'), \ - 'a simple check with a single VersionCheck is useless' - populate_simple_opt_with_data(opt, data, data_type) def populate_with_data(checklist, data, data_type):