From 7be26329c5ccfefaba3b718942bef0a81f275d94 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 26 May 2024 15:28:53 +0100 Subject: [PATCH] Apply suggestions from code review --- Library/Homebrew/sbom.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/sbom.rb b/Library/Homebrew/sbom.rb index 5e64c208dfe20..98f16bb513e6d 100644 --- a/Library/Homebrew/sbom.rb +++ b/Library/Homebrew/sbom.rb @@ -121,12 +121,12 @@ def self.fetch_schema! end end - sig { params(bottling: T::Boolean).returns(T.nilable(T::Boolean)) } + sig { params(bottling: T::Boolean).returns(T::Boolean) } def valid?(bottling: false) unless require? "json_schemer" error_message = "Need json_schemer to validate SBOM, run `brew install-bundler-gems --add-groups=bottle`!" odie error_message if ENV["HOMEBREW_ENFORCE_SBOM"] - return nil + return true end schema = SBOM.fetch_schema! @@ -156,7 +156,7 @@ def write(validate: true, bottling: false) # will no longer be valid. Formula.clear_cache unless spdxfile.exist? - if validate && (valid = valid?(bottling:)).present? && !valid + if validate && !valid?(bottling:) opoo "SBOM is not valid, not writing to disk!" return end