From 3c9e339c19e4e93c560bc830aefbd5bacc2f343d Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Mon, 30 Jun 2025 11:11:56 -0700 Subject: [PATCH] Fix exit code from returning 5 on diff reports with no error alerts and only warn --- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/output.py | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c2d393b..5f8e503 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.1.18" +version = "2.1.19" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 10d169f..0d6d5b0 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,2 +1,2 @@ __author__ = 'socket.dev' -__version__ = '2.1.18' +__version__ = '2.1.19' diff --git a/socketsecurity/output.py b/socketsecurity/output.py index a1f8647..eca30a2 100644 --- a/socketsecurity/output.py +++ b/socketsecurity/output.py @@ -52,10 +52,11 @@ def return_exit_code(self, diff_report: Diff) -> int: if not self.report_pass(diff_report): return 1 - - if len(diff_report.new_alerts) > 0: - # 5 means warning alerts but no blocking alerts - return 5 + + # if there are only warn alerts should be returning 0. This was not intended behavior + # if len(diff_report.new_alerts) > 0: + # # 5 means warning alerts but no blocking alerts + # return 5 return 0 def output_console_comments(self, diff_report: Diff, sbom_file_name: Optional[str] = None) -> None: