Skip to content

Commit 67e1548

Browse files
committed
chore(cli[convert]): Typings
1 parent c8630d8 commit 67e1548

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tmuxp/cli/convert.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def command_convert(
5050

5151
_, ext = os.path.splitext(workspace_file)
5252
ext = ext.lower()
53+
to_filetype: t.Literal["json", "yaml"]
5354
if ext == ".json":
5455
to_filetype = "yaml"
5556
elif ext in [".yaml", ".yml"]:
@@ -60,8 +61,11 @@ def command_convert(
6061
configparser = ConfigReader.from_file(workspace_file)
6162
newfile = workspace_file.parent / (str(workspace_file.stem) + f".{to_filetype}")
6263

63-
export_kwargs = {"default_flow_style": False} if to_filetype == "yaml" else {}
64-
new_workspace = configparser.dump(format=to_filetype, indent=2, **export_kwargs)
64+
new_workspace = configparser.dump(
65+
format=to_filetype,
66+
indent=2,
67+
**{"default_flow_style": False} if to_filetype == "yaml" else {},
68+
)
6569

6670
if not answer_yes:
6771
if prompt_yes_no(f"Convert to <{workspace_file}> to {to_filetype}?"):

0 commit comments

Comments
 (0)