Skip to content

Commit

Permalink
Incorporate review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ikretz committed Oct 17, 2024
1 parent 76436d3 commit e7020d0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions guarddog/analyzer/metadata/bundled_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ def sha256(file: str) -> str:
bin_files[digest] = [format_file(f, kind)]
else:
bin_files[digest].append(format_file(f, kind))
if bin_files:
output_lines = '\n'.join(
f"{digest}: {', '.join(files)}" for digest, files in bin_files.items()
)
return True, f"Binary file/s detected in package:\n{output_lines}"
return False, ""

if not bin_files:
return False, ""

output_lines = '\n'.join(
f"{digest}: {', '.join(files)}" for digest, files in bin_files.items()
)
return True, f"Binary file/s detected in package:\n{output_lines}"

def is_binary(self, path: str) -> Optional[str]:
max_head = len(max(self.magic_bytes.values()))
Expand Down

0 comments on commit e7020d0

Please sign in to comment.