mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
rubocop fixes
Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
parent
48e39bb51d
commit
578c2bc9da
@ -16,7 +16,7 @@ module Homebrew
|
|||||||
|
|
||||||
# No backfill attestations after this date are considered valid.
|
# No backfill attestations after this date are considered valid.
|
||||||
# @api private
|
# @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.
|
# 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)
|
def self.check_attestation(bottle, signing_repo, signing_workflow = nil)
|
||||||
cmd = [HOMEBREW_GH, "attestation", "verify", bottle.cached_download, "--repo", signing_repo, "--format", "json"]
|
cmd = [HOMEBREW_GH, "attestation", "verify", bottle.cached_download, "--repo", signing_repo, "--format", "json"]
|
||||||
|
|
||||||
unless signing_workflow.nil?
|
cmd += ["--cert-identity", signing_workflow] unless signing_workflow.nil?
|
||||||
cmd += ["--cert-identity", signing_workflow]
|
|
||||||
end
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
output = Utils.safe_popen_read(*cmd)
|
output = Utils.safe_popen_read(*cmd)
|
||||||
@ -46,7 +44,7 @@ module Homebrew
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
data = JSON.parse(output)
|
data = JSON.parse(output)
|
||||||
rescue JSON::ParserError => e
|
rescue JSON::ParserError
|
||||||
raise InvalidAttestationError, "attestation verification returned malformed JSON"
|
raise InvalidAttestationError, "attestation verification returned malformed JSON"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ module Homebrew
|
|||||||
"useful to avoid long-running Homebrew commands being killed due to no output.",
|
"useful to avoid long-running Homebrew commands being killed due to no output.",
|
||||||
boolean: true,
|
boolean: true,
|
||||||
},
|
},
|
||||||
HOMEBREW_VERIFY_ATTESTATIONS: {
|
HOMEBREW_VERIFY_ATTESTATIONS: {
|
||||||
description: "If set, Homebrew will use the `gh` tool to verify cryptographic attestations " \
|
description: "If set, Homebrew will use the `gh` tool to verify cryptographic attestations " \
|
||||||
"of build provenance for bottles from homebrew-core.",
|
"of build provenance for bottles from homebrew-core.",
|
||||||
boolean: true,
|
boolean: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user