Skip to content

Commit 0530b45

Browse files
authored
Merge pull request #21170 from Homebrew/codesign_requirement-type-and-deprecate
requirements/codesign_requirement: `typed: strict` and deprecate
2 parents 74dbbb9 + 0d25b32 commit 0530b45

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Library/Homebrew/requirements/codesign_requirement.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
# typed: true # rubocop:todo Sorbet/StrictSigil
1+
# typed: strict
22
# frozen_string_literal: true
33

44
# A requirement on a code-signing identity.
55
class CodesignRequirement < Requirement
66
fatal true
77

8+
sig { returns(String) }
9+
attr_reader :identity
10+
11+
sig { params(tags: T::Array[T.untyped]).void }
812
def initialize(tags)
913
options = tags.shift
1014
raise ArgumentError, "CodesignRequirement requires an options Hash!" unless options.is_a?(Hash)
1115
raise ArgumentError, "CodesignRequirement requires an identity key!" unless options.key?(:identity)
1216

13-
@identity = options.fetch(:identity)
14-
@with = options.fetch(:with, "code signing")
15-
@url = options.fetch(:url, nil)
17+
@identity = T.let(options.fetch(:identity), String)
18+
@with = T.let(options.fetch(:with, "code signing"), String)
19+
@url = T.let(options.fetch(:url, nil), T.nilable(String))
1620
super
1721
end
1822

1923
satisfy(build_env: false) do
2024
T.bind(self, CodesignRequirement)
25+
odeprecated "CodesignRequirement"
2126
mktemp do
2227
FileUtils.cp "/usr/bin/false", "codesign_check"
23-
quiet_system "/usr/bin/codesign", "-f", "-s", @identity,
28+
quiet_system "/usr/bin/codesign", "-f", "-s", identity,
2429
"--dryrun", "codesign_check"
2530
end
2631
end

0 commit comments

Comments
 (0)