From 29453523b2718606e8032590b5d916b189924af9 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 21 Jun 2026 16:34:01 +0200 Subject: [PATCH] fix: do not copy help and tags from types --- src/rougail/convert/collect.py | 6 +++++- .../result/error_variable_redefine/namespace_tiramisu.py | 2 +- .../result/family_secret_manager/namespace_tiramisu.py | 4 ++-- tests/types/result/family_secret_manager/tiramisu.py | 4 ++-- tests/types/result/secret_manager/namespace_tiramisu.py | 4 ++-- tests/types/result/secret_manager/tiramisu.py | 4 ++-- tests/types/result/variable/namespace_tiramisu.py | 2 +- tests/types/result/variable/tiramisu.py | 2 +- tests/types/result/variables/namespace_tiramisu.py | 2 +- tests/types/result/variables/tiramisu.py | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/rougail/convert/collect.py b/src/rougail/convert/collect.py index dc680e674..c4980477d 100644 --- a/src/rougail/convert/collect.py +++ b/src/rougail/convert/collect.py @@ -20,7 +20,6 @@ along with this program. If not, see . import logging from warnings import warn from pydantic import ValidationError -from copy import deepcopy from typing import ( Any, Iterator, @@ -294,6 +293,11 @@ class CollectType: self.types.name = self.name self.types.path = self.path self.types.namespace = self.namespace + self.types.help = None + self.types.tags = [] + if not from_parent: + self.types.parameters["help"] = None + self.types.parameters["tags"] = [] self.option_type = self.types.option_type self.user_type = self.types.user_type self.sources = self.types.sources + self.sources diff --git a/tests/types/result/error_variable_redefine/namespace_tiramisu.py b/tests/types/result/error_variable_redefine/namespace_tiramisu.py index 646f6ea3d..f0824fda2 100644 --- a/tests/types/result/error_variable_redefine/namespace_tiramisu.py +++ b/tests/types/result/error_variable_redefine/namespace_tiramisu.py @@ -9,5 +9,5 @@ except: ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") -option_1 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/error_variable_redefine/00_type.yml', 'tests/types/structures/error_variable_redefine/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +option_1 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/error_variable_redefine/00_type.yml', 'tests/types/structures/error_variable_redefine/00_structure.yml'], 'type': 'string'}) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) diff --git a/tests/types/result/family_secret_manager/namespace_tiramisu.py b/tests/types/result/family_secret_manager/namespace_tiramisu.py index ae027782f..34d290510 100644 --- a/tests/types/result/family_secret_manager/namespace_tiramisu.py +++ b/tests/types/result/family_secret_manager/namespace_tiramisu.py @@ -10,9 +10,9 @@ ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") option_2 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'}) -option_3 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) +option_3 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) optiondescription_1 = OptionDescription(name="secret1", doc="Family with secret", children=[option_2, option_3], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']}) option_5 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'}) -option_6 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) +option_6 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) optiondescription_4 = OptionDescription(name="secret2", doc="Family with secret", children=[option_5, option_6], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']}) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4]) diff --git a/tests/types/result/family_secret_manager/tiramisu.py b/tests/types/result/family_secret_manager/tiramisu.py index 6fa66b651..5cdc8ed5e 100644 --- a/tests/types/result/family_secret_manager/tiramisu.py +++ b/tests/types/result/family_secret_manager/tiramisu.py @@ -10,10 +10,10 @@ ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") option_4 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'}) -option_5 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) +option_5 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) optiondescription_3 = OptionDescription(name="secret1", doc="Family with secret", children=[option_4, option_5], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']}) option_7 = StrOption(name="a_variable", doc="A variable", default="my_value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'string'}) -option_8 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) +option_8 = PasswordOption(name="secret", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml'], 'type': 'secret'}) optiondescription_6 = OptionDescription(name="secret2", doc="Family with secret", children=[option_7, option_8], properties=frozenset({"basic"}), informations={'ymlfiles': ['tests/types/types/family_secret_manager/00-base.yml', 'tests/types/structures/family_secret_manager/00-base.yml']}) optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[optiondescription_3, optiondescription_6], properties=frozenset({"basic"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/types/result/secret_manager/namespace_tiramisu.py b/tests/types/result/secret_manager/namespace_tiramisu.py index 5e2e4abeb..6353ae1ee 100644 --- a/tests/types/result/secret_manager/namespace_tiramisu.py +++ b/tests/types/result/secret_manager/namespace_tiramisu.py @@ -9,6 +9,6 @@ except: ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") -option_1 = PasswordOption(name="secret1", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) -option_2 = PasswordOption(name="secret2", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) +option_1 = PasswordOption(name="secret1", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) +option_2 = PasswordOption(name="secret2", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2]) diff --git a/tests/types/result/secret_manager/tiramisu.py b/tests/types/result/secret_manager/tiramisu.py index ecf9bc146..ec60e1a0a 100644 --- a/tests/types/result/secret_manager/tiramisu.py +++ b/tests/types/result/secret_manager/tiramisu.py @@ -9,7 +9,7 @@ except: ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") -option_3 = PasswordOption(name="secret1", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) -option_4 = PasswordOption(name="secret2", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) +option_3 = PasswordOption(name="secret1", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) +option_4 = PasswordOption(name="secret2", doc="the secret", properties=frozenset({"basic", "mandatory", "novalidator"}), informations={'secret_manager': True, 'ymlfiles': ['tests/types/types/secret_manager/00-base.yml', 'tests/types/structures/secret_manager/00-base.yml'], 'type': 'secret'}) optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/types/result/variable/namespace_tiramisu.py b/tests/types/result/variable/namespace_tiramisu.py index 89b39b80b..8f42f30df 100644 --- a/tests/types/result/variable/namespace_tiramisu.py +++ b/tests/types/result/variable/namespace_tiramisu.py @@ -9,5 +9,5 @@ except: ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") -option_1 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variable/00_type.yml', 'tests/types/structures/variable/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +option_1 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable/00_type.yml', 'tests/types/structures/variable/00_structure.yml'], 'type': 'string'}) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1]) diff --git a/tests/types/result/variable/tiramisu.py b/tests/types/result/variable/tiramisu.py index 2d08e2ec3..abea33aa6 100644 --- a/tests/types/result/variable/tiramisu.py +++ b/tests/types/result/variable/tiramisu.py @@ -9,6 +9,6 @@ except: ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") -option_3 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variable/00_type.yml', 'tests/types/structures/variable/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +option_3 = StrOption(name="my_var", doc="My type", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variable/00_type.yml', 'tests/types/structures/variable/00_structure.yml'], 'type': 'string'}) optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2]) diff --git a/tests/types/result/variables/namespace_tiramisu.py b/tests/types/result/variables/namespace_tiramisu.py index cb279556b..19405ffa7 100644 --- a/tests/types/result/variables/namespace_tiramisu.py +++ b/tests/types/result/variables/namespace_tiramisu.py @@ -10,6 +10,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") option_1 = StrOption(name="my_var1", doc="My type", default="a value", properties=frozenset({"an_other_tag", "mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('an_other_tag',)}) -option_2 = StrOption(name="my_var2", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +option_2 = StrOption(name="my_var2", doc="My type", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string'}) option_3 = StrOption(name="my_var3", doc="my_var3", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/structures/variables/00_structure.yml'], 'type': 'string'}) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3]) diff --git a/tests/types/result/variables/tiramisu.py b/tests/types/result/variables/tiramisu.py index 375d17cad..aaf83b967 100644 --- a/tests/types/result/variables/tiramisu.py +++ b/tests/types/result/variables/tiramisu.py @@ -10,7 +10,7 @@ ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("standard") ALLOWED_LEADER_PROPERTIES.add("advanced") option_3 = StrOption(name="my_var1", doc="My type", default="a value", properties=frozenset({"an_other_tag", "mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('an_other_tag',)}) -option_4 = StrOption(name="my_var2", doc="My type", default="a value", properties=frozenset({"mandatory", "one_tag", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string', 'tags': ('one_tag',)}) +option_4 = StrOption(name="my_var2", doc="My type", default="a value", properties=frozenset({"mandatory", "standard"}), informations={'ymlfiles': ['tests/types/types/variables/00_type.yml', 'tests/types/structures/variables/00_structure.yml'], 'type': 'string'}) option_5 = StrOption(name="my_var3", doc="my_var3", properties=frozenset({"basic", "mandatory"}), informations={'ymlfiles': ['tests/types/structures/variables/00_structure.yml'], 'type': 'string'}) optiondescription_2 = OptionDescription(name="ns2", doc="NS2", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"basic"})) option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_2])