mirror of
https://github.com/Homebrew/brew.git
synced 2026-10-28 09:34:42 +08:00
vulns: raise let-free spec files to typed: strict
utils/repology_spec, identify_spec and purl_spec go to typed: strict with sigs added on their helper methods. cpan_sec_spec, vulns/repology_spec, match_spec and dev-cmd/advisory-match_spec stay at typed: true because they use let, which generates a sig-less method that strict rejects (no brew spec at typed: strict uses let).
This commit is contained in:
3 files changed
+8
-3
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "utils/repology"
|
||||
@@ -10,6 +10,10 @@ RSpec.describe Repology do
|
||||
end
|
||||
|
||||
describe ".single_package_query" do
|
||||
sig {
|
||||
params(success: T::Boolean, stdout: String, stderr: String, exit_status: Integer)
|
||||
.returns(T.untyped)
|
||||
}
|
||||
def stub_curl(success:, stdout: "", stderr: "", exit_status: 0)
|
||||
instance_double(SystemCommand::Result, success?: success, stdout:, stderr:, exit_status:)
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "vulns/identify"
|
||||
@@ -146,6 +146,7 @@ RSpec.describe Homebrew::Vulns::Identify do
|
||||
end
|
||||
|
||||
describe ".registry_package" do
|
||||
sig { params(url: T.nilable(String)).returns(T.nilable(T::Hash[Symbol, T.untyped])) }
|
||||
def result(url)
|
||||
described_class.registry_package(url)&.to_h
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# typed: true
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "vulns/purl"
|
||||
|
||||
Reference in new issue
Block a user