Skip to content

Commit 083f5f8

Browse files
committed
chore(mypy): Typings for config_reader
1 parent 954f36f commit 083f5f8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/tmuxp/config_reader.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ def _load(format: "FormatLiteral", content: str) -> t.Dict[str, t.Any]:
3636
{'session_name': 'my session'}
3737
"""
3838
if format == "yaml":
39-
return yaml.load(
40-
content,
41-
Loader=yaml.SafeLoader,
39+
return t.cast(
40+
t.Dict[str, t.Any],
41+
yaml.load(
42+
content,
43+
Loader=yaml.SafeLoader,
44+
),
4245
)
4346
elif format == "json":
44-
return json.loads(content)
47+
return t.cast(t.Dict[str, t.Any], json.loads(content))
4548
else:
4649
raise NotImplementedError(f"{format} not supported in configuration")
4750

0 commit comments

Comments
 (0)