feat: keep forced_descriptions information (mostly for rougail-output-doc)

This commit is contained in:
egarette@silique.fr 2025-10-14 13:57:09 +02:00
parent 5d8278acf8
commit 4df2b013df
4 changed files with 5 additions and 7 deletions

View file

@ -122,6 +122,7 @@ class Annotator(Walk):
for family in self.get_families(): for family in self.get_families():
if not family.description: if not family.description:
family.description = family.name family.description = family.name
self.objectspace.forced_descriptions.append(family.path)
if family.type == "dynamic" and isinstance( if family.type == "dynamic" and isinstance(
family.dynamic, VariableCalculation family.dynamic, VariableCalculation
): ):

View file

@ -232,6 +232,7 @@ class Annotator(Walk): # pylint: disable=R0903
# variable without description: description is the name # variable without description: description is the name
if not variable.description: if not variable.description:
variable.description = variable.name variable.description = variable.name
self.objectspace.forced_descriptions.append(variable.path)
if variable.type is None: if variable.type is None:
variable.type = "string" variable.type = "string"
self.objectspace.informations.add(variable.path, "type", variable.type) self.objectspace.informations.add(variable.path, "type", variable.type)

View file

@ -144,6 +144,7 @@ class ParserVariable:
self.dynamics_variable = {} self.dynamics_variable = {}
self.multis = {} self.multis = {}
self.default_multi = {} self.default_multi = {}
self.forced_descriptions = []
self.jinja = {} self.jinja = {}
# #
self.convert_options = list(CONVERT_OPTION) self.convert_options = list(CONVERT_OPTION)

View file

@ -283,8 +283,9 @@ class UserDatas:
def _populate_error_warnings(self): def _populate_error_warnings(self):
# we don't find variable, apply value just to get error or warning messages # we don't find variable, apply value just to get error or warning messages
for path, options in self.values.items(): for path, options in self.values.items():
if "{{ identifier }}" in path:
continue
value = options["values"] value = options["values"]
if options.get('secret_manager'): if options.get('secret_manager'):
option = self.config.forcepermissive.option(path) option = self.config.forcepermissive.option(path)
else: else:
@ -431,13 +432,7 @@ class UserDatas:
if is_secret_manager and isinstance(value, tuple): if is_secret_manager and isinstance(value, tuple):
# it's a function # it's a function
value = value[0](*value[1:], option=option, warnings=self.warnings, errors=self.errors) value = value[0](*value[1:], option=option, warnings=self.warnings, errors=self.errors)
if is_secret_manager and "hidden" in option.property.get():
option.permissive.add("hidden")
option.permissive.add("frozen")
option.value.set(value) option.value.set(value)
if is_secret_manager and "hidden" in option.property.get():
option.permissive.remove("hidden")
option.permissive.remove("frozen")
def convert_value(option, value): def convert_value(option, value):