Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
YaaraVerner committed Oct 2, 2023
1 parent 92e183b commit b255035
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checkov/common/bridgecrew/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def persist_resource_subgraph_maps(
full_repo_object_key: str,
timeout: int
) -> None:
def _upload_resource_subgraph_map(check_type: str, resource_subgraph_map: dict[str, str]):
def _upload_resource_subgraph_map(check_type: str, resource_subgraph_map: dict[str, str]) -> None:
s3_key = os.path.join(graphs_repo_object_key, check_type, "multi-graph/resource_subgraph_maps")
try:
_put_json_object(s3_client, resource_subgraph_map, bucket, s3_key)
Expand Down
2 changes: 1 addition & 1 deletion checkov/common/runners/runner_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,4 @@ def extract_graphs_from_runner(runner: _BaseRunner) -> list[tuple[LibraryGraph,
@staticmethod
def extract_resource_subgraph_map_from_runner(runner: _BaseRunner) -> Optional[dict[str, str]]:
# exist only for terraform
return getattr(runner, 'resource_subgraph_map', None) # type:ignore[no-any-return]
return getattr(runner, 'resource_subgraph_map', None)
4 changes: 3 additions & 1 deletion checkov/terraform/graph_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def build_multi_graph_from_definitions(self, definitions: dict[TFDefinitionKey,
return graphs

@staticmethod
def update_resource_subgraph_map(local_graph: TerraformLocalGraph, subgraph_path: str, resource_subgraph_map: dict[str, str], source_dir: str):
def update_resource_subgraph_map(
local_graph: TerraformLocalGraph, subgraph_path: str, resource_subgraph_map: dict[str, str], source_dir: str
) -> None:
for v in local_graph.vertices:
resource_id = f"/{os.path.relpath(v.path, source_dir)}:{v.id}"
resource_subgraph_map[resource_id] = subgraph_path

0 comments on commit b255035

Please sign in to comment.