Merge pull request #13183 from apainintheneck/fix-sorbet-type

cli/parser: Re-enable Sorbet Type Checking
This commit is contained in:
Bo Anderson 2022-04-25 15:09:45 +01:00 committed by GitHub
commit 968366696b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,9 +107,7 @@ module Homebrew
]
end
# FIXME: Block should be `T.nilable(T.proc.bind(Parser).void)`.
# See https://github.com/sorbet/sorbet/issues/498.
sig { params(block: T.proc.bind(Parser).void).void.checked(:never) }
sig { params(block: T.nilable(T.proc.bind(Parser).void)).void }
def initialize(&block)
@parser = OptionParser.new
@ -123,7 +121,9 @@ module Homebrew
@args = Homebrew::CLI::Args.new
@command_name = caller_locations(2, 1).first.label.chomp("_args").tr("_", "-")
# Filter out Sorbet runtime type checking method calls.
@command_name = caller_locations.select { |location| location.path.exclude?("/gems/sorbet-runtime-") }
.second.label.chomp("_args").tr("_", "-")
@constraints = []
@conflicts = []