Skip to content

Commit

Permalink
Fix mypy3
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmithv11 committed Jan 15, 2025
1 parent bb1970c commit c0ae911
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions checkov/arm/checks/resource/AKSMaxPodsMinimum.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def scan_resource_conf(self, conf: dict[str, Any]) -> CheckResult:

max_pods = properties.get("maxPods")

if "agentPoolProfiles" in properties and isinstance(properties["agentPoolProfiles"], list) and properties[
"agentPoolProfiles"]:
if ("agentPoolProfiles" in properties and isinstance(properties["agentPoolProfiles"], list) and
properties["agentPoolProfiles"]):
agent_pool = properties["agentPoolProfiles"][0]
if isinstance(agent_pool, dict) and "maxPods" in agent_pool:
max_pods = agent_pool["maxPods"]
Expand Down
6 changes: 5 additions & 1 deletion checkov/secrets/scan_git_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ def _get_first_commit(self) -> Commit:

for file_diff in git_diff:
file_name = file_diff.b_path
if not file_name: # Add null check
continue
if file_name.endswith(FILES_TO_IGNORE_IN_GIT_HISTORY):
continue
file_path = os.path.join(self.root_folder, file_name)
Expand All @@ -250,9 +252,11 @@ def _get_first_commit(self) -> Commit:
return first_commit_diff

@staticmethod
def get_decoded_diff(diff: bytes | None) -> str:
def get_decoded_diff(diff: str | bytes | None) -> str:
if not diff:
return ''
if isinstance(diff, str):
return diff
try:
decoded_diff = diff.decode('utf-8')
except UnicodeDecodeError as ue:
Expand Down

0 comments on commit c0ae911

Please sign in to comment.