cmds.projects.lib.templates.tmpl_render(): RenderValues

tmpl_render()'s "values" argument currently understands dict[str,str|list[str]]. Enhance that to understand the broader RenderValues type, which also includes Iterable[tuple[str, str]], as produced by argparse.add_argument(action='append').

This commit also adds proper type-checking for the values argument. Before, its type had gone unchecked entirely.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-04 07:27:52 +02:00
commit 81e71bc5c1
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
3 changed files with 103 additions and 20 deletions

View file

@ -65,7 +65,7 @@ class CmdCreateFile(Cmd): # export
self.__update_dict(values, extra_fields)
return tmpl_render(
'pyrightconfig.json', values, li_quote = True, li_delimiter = ',\n'
'pyrightconfig.json', [values], li_quote = True, li_delimiter = ',\n'
)
def __init__(self, parent: Parent) -> None: