rubocop fixes

Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
William Woodruff 2024-04-08 16:21:31 -04:00
parent 48e39bb51d
commit 578c2bc9da
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View File

@ -16,7 +16,7 @@ module Homebrew
# No backfill attestations after this date are considered valid.
# @api private
BACKFILL_CUTOFF = DateTime.new(2024, 3, 14)
BACKFILL_CUTOFF = DateTime.new(2024, 3, 14).freeze
# Verifies the given bottle against a cryptographic attestation of build provenance.
#
@ -34,9 +34,7 @@ module Homebrew
def self.check_attestation(bottle, signing_repo, signing_workflow = nil)
cmd = [HOMEBREW_GH, "attestation", "verify", bottle.cached_download, "--repo", signing_repo, "--format", "json"]
unless signing_workflow.nil?
cmd += ["--cert-identity", signing_workflow]
end
cmd += ["--cert-identity", signing_workflow] unless signing_workflow.nil?
begin
output = Utils.safe_popen_read(*cmd)
@ -46,7 +44,7 @@ module Homebrew
begin
data = JSON.parse(output)
rescue JSON::ParserError => e
rescue JSON::ParserError
raise InvalidAttestationError, "attestation verification returned malformed JSON"
end

View File

@ -422,7 +422,7 @@ module Homebrew
"useful to avoid long-running Homebrew commands being killed due to no output.",
boolean: true,
},
HOMEBREW_VERIFY_ATTESTATIONS: {
HOMEBREW_VERIFY_ATTESTATIONS: {
description: "If set, Homebrew will use the `gh` tool to verify cryptographic attestations " \
"of build provenance for bottles from homebrew-core.",
boolean: true,