Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
YaaraVerner committed Sep 26, 2023
1 parent 6630bf1 commit 715db0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions checkov/common/bridgecrew/platform_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from os import path
from pathlib import Path
from time import sleep
from typing import List, Dict, TYPE_CHECKING, Any, cast, Tuple, Optional
from typing import List, Dict, TYPE_CHECKING, Any, cast, Optional

import boto3
import dpath
Expand Down Expand Up @@ -558,7 +558,7 @@ def persist_logs_stream(self, logs_stream: StringIO) -> None:
log_path = f'{self.support_repo_path}/checkov_results' if self.support_repo_path == self.repo_path else self.support_repo_path
persist_logs_stream(logs_stream, self.s3_client, self.support_bucket, log_path)

def persist_graphs(self, graphs: dict[str, list[Tuple[DiGraph | Graph, Optional[str]]]], absolute_root_folder: str = '') -> None:
def persist_graphs(self, graphs: dict[str, list[tuple[DiGraph | Graph, Optional[str]]]], absolute_root_folder: str = '') -> None:
if not self.use_s3_integration or not self.s3_client:
return
if not self.bucket or not self.repo_path:
Expand Down
8 changes: 4 additions & 4 deletions checkov/common/runners/runner_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from collections import defaultdict
from collections.abc import Iterable
from pathlib import Path
from typing import List, Dict, Any, Optional, cast, TYPE_CHECKING, Type, Tuple
from typing import List, Dict, Any, Optional, cast, TYPE_CHECKING, Type

from typing_extensions import Literal

Expand Down Expand Up @@ -95,7 +95,7 @@ def __init__(
self._check_type_to_report_map: dict[str, Report] = {} # used for finding reports with the same check type
self.licensing_integration = licensing_integration # can be maniuplated by unit tests
self.secrets_omitter_class = secrets_omitter_class
self.check_type_to_graph: dict[str, list[Tuple[LibraryGraph, Optional[str]]]] = {}
self.check_type_to_graph: dict[str, list[tuple[LibraryGraph, Optional[str]]]] = {}
for runner in runners:
if isinstance(runner, image_runner):
runner.image_referencers = self.image_referencing_runners
Expand Down Expand Up @@ -124,7 +124,7 @@ def run(
# This is the only runner, so raise a clear indication of failure
raise ModuleNotEnabledError(f'The framework "{runner_check_type}" is part of the "{self.licensing_integration.get_subscription_for_runner(runner_check_type).name}" module, which is not enabled in the platform')
else:
def _parallel_run(runner: _BaseRunner) -> tuple[Report | list[Report], str | None, Optional[list[Tuple[LibraryGraph, Optional[str]]]]]:
def _parallel_run(runner: _BaseRunner) -> tuple[Report | list[Report], str | None, Optional[list[tuple[LibraryGraph, Optional[str]]]]]:
report = runner.run(
root_folder=root_folder,
external_checks_dir=external_checks_dir,
Expand Down Expand Up @@ -750,7 +750,7 @@ def extract_git_info_from_account_id(account_id: str) -> tuple[str, str]:
return git_org, git_repository

@staticmethod
def extract_graphs_from_runner(runner: _BaseRunner) -> List[Tuple[LibraryGraph, Optional[str]]]:
def extract_graphs_from_runner(runner: _BaseRunner) -> list[tuple[LibraryGraph, Optional[str]]]:
# exist only for terraform
all_graphs = getattr(runner, 'all_graphs', None)
if all_graphs:
Expand Down

0 comments on commit 715db0c

Please sign in to comment.