From 18380b6a119237816da6aa33546b17268e97b568 Mon Sep 17 00:00:00 2001 From: twald Date: Thu, 23 Jan 2025 10:59:07 +0200 Subject: [PATCH] remove asserts --- checkov/secrets/scan_git_history.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/checkov/secrets/scan_git_history.py b/checkov/secrets/scan_git_history.py index 36076de229c..d6edf5b2a2a 100644 --- a/checkov/secrets/scan_git_history.py +++ b/checkov/secrets/scan_git_history.py @@ -148,8 +148,7 @@ def _get_commits_diff(self, last_commit_sha: Optional[str] = None) -> List[Commi ) ) for file_diff in git_diff: - file_name = file_diff.a_path if file_diff.a_path else file_diff.b_path - assert file_name is not None + file_name: str = file_diff.a_path if file_diff.a_path else file_diff.b_path # type:ignore if file_name.endswith(FILES_TO_IGNORE_IN_GIT_HISTORY): continue file_path = os.path.join(self.root_folder, file_name) @@ -241,8 +240,7 @@ def _get_first_commit(self) -> Commit: ) for file_diff in git_diff: - file_name = file_diff.b_path - assert file_name is not None + file_name: str = file_diff.b_path # type:ignore if file_name.endswith(FILES_TO_IGNORE_IN_GIT_HISTORY): continue file_path = os.path.join(self.root_folder, file_name)