Fix sbom spec
This commit is contained in:
parent
4609bb60a3
commit
dbd89f6899
@ -71,9 +71,9 @@ module Cask
|
|||||||
config = JSON.parse(json, symbolize_names: true)
|
config = JSON.parse(json, symbolize_names: true)
|
||||||
|
|
||||||
new(
|
new(
|
||||||
default: config.fetch("default", {}),
|
default: config.fetch(:default, {}),
|
||||||
env: config.fetch("env", {}),
|
env: config.fetch(:env, {}),
|
||||||
explicit: config.fetch("explicit", {}),
|
explicit: config.fetch(:explicit, {}),
|
||||||
ignore_invalid_keys:,
|
ignore_invalid_keys:,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class SBOM
|
|||||||
formula.prefix/FILENAME
|
formula.prefix/FILENAME
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(deps: T::Array[T::Hash[String, String]]).returns(T::Array[T::Hash[String, String]]) }
|
sig { params(deps: T::Array[T::Hash[String, T.untyped]]).returns(T::Array[T::Hash[String, T.untyped]]) }
|
||||||
def self.runtime_deps_hash(deps)
|
def self.runtime_deps_hash(deps)
|
||||||
deps.map do |dep|
|
deps.map do |dep|
|
||||||
full_name = dep.fetch("full_name")
|
full_name = dep.fetch("full_name")
|
||||||
@ -88,7 +88,7 @@ class SBOM
|
|||||||
@schema ||= T.let(JSON.parse(SCHEMA_FILE.read, freeze: true), T.nilable(T::Hash[String, T.untyped]))
|
@schema ||= T.let(JSON.parse(SCHEMA_FILE.read, freeze: true), T.nilable(T::Hash[String, T.untyped]))
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(bottling: T::Boolean).returns(T::Array[T::Hash[String, T.untyped]]) }
|
sig { params(bottling: T::Boolean).returns(T::Array[String]) }
|
||||||
def schema_validation_errors(bottling: false)
|
def schema_validation_errors(bottling: false)
|
||||||
unless Homebrew.require? "json_schemer"
|
unless Homebrew.require? "json_schemer"
|
||||||
error_message = "Need json_schemer to validate SBOM, run `brew install-bundler-gems --add-groups=bottle`!"
|
error_message = "Need json_schemer to validate SBOM, run `brew install-bundler-gems --add-groups=bottle`!"
|
||||||
@ -254,9 +254,8 @@ class SBOM
|
|||||||
end
|
end
|
||||||
|
|
||||||
sig {
|
sig {
|
||||||
params(bottling: T::Boolean).returns(T::Array[T::Hash[Symbol,
|
params(bottling: T::Boolean)
|
||||||
T.any(T::Boolean, String,
|
.returns(T::Array[T::Hash[Symbol, T.any(T::Boolean, String, T::Array[T::Hash[Symbol, String]])]])
|
||||||
T::Array[T::Hash[Symbol, String]])]])
|
|
||||||
}
|
}
|
||||||
def full_spdx_runtime_dependencies(bottling:)
|
def full_spdx_runtime_dependencies(bottling:)
|
||||||
return [] if bottling || @runtime_dependencies.blank?
|
return [] if bottling || @runtime_dependencies.blank?
|
||||||
@ -355,7 +354,7 @@ class SBOM
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(base: T.nilable(T::Hash[String, Hash])).returns(T.nilable(T::Hash[String, String])) }
|
sig { params(base: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, String])) }
|
||||||
def get_bottle_info(base)
|
def get_bottle_info(base)
|
||||||
return unless base.present?
|
return unless base.present?
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user