Skip to content

Commit e6cffd7

Browse files
authored
Merge pull request #94 from opsmill/pog-cli-commands-typing
Fix typing for CLI commands
2 parents 3224641 + 1ac18f6 commit e6cffd7

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

infrahub_sdk/ctl/cli_commands.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _run_transform(
206206
branch: str,
207207
debug: bool,
208208
repository_config: InfrahubRepositoryConfig,
209-
):
209+
) -> Any:
210210
"""
211211
Query GraphQL for the required data then run a transform on that data.
212212
@@ -382,7 +382,8 @@ def protocols( # noqa: PLR0915
382382

383383
for data in schemas_data:
384384
data.load_content()
385-
schema_root = SchemaRoot(**data.content)
385+
schema_root_data = data.content or {}
386+
schema_root = SchemaRoot(**schema_root_data)
386387
schema.update({item.kind: item for item in schema_root.nodes + schema_root.generics})
387388

388389
else:
@@ -401,7 +402,7 @@ def protocols( # noqa: PLR0915
401402

402403
@app.command(name="version")
403404
@catch_exception(console=console)
404-
def version(_: str = CONFIG_PARAM):
405+
def version(_: str = CONFIG_PARAM) -> None:
405406
"""Display the version of Infrahub and the version of the Python SDK in use."""
406407

407408
client = initialize_client_sync()

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ disallow_untyped_defs = true
155155
module = "infrahub_sdk.ctl.check"
156156
ignore_errors = true
157157

158-
[[tool.mypy.overrides]]
159-
module = "infrahub_sdk.ctl.cli_commands"
160-
ignore_errors = true
161-
162158
[[tool.mypy.overrides]]
163159
module = "infrahub_sdk.ctl.generator"
164160
ignore_errors = true

0 commit comments

Comments
 (0)