diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index 76f653aad4..6f185bc216 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -1,6 +1,7 @@ -# typed: false +# typed: true # frozen_string_literal: true +# `HOMEBREW_STACKPROF` should be set via `brew prof --stackprof`, not manually. if ENV["HOMEBREW_STACKPROF"] require "rubygems" require "stackprof" @@ -35,8 +36,8 @@ begin empty_argv = ARGV.empty? help_flag_list = %w[-h --help --usage -?] help_flag = !ENV["HOMEBREW_HELP"].nil? - help_cmd_index = nil - cmd = nil + help_cmd_index = T.let(nil, T.nilable(Integer)) + cmd = T.let(nil, T.nilable(String)) ARGV.each_with_index do |arg, i| break if help_flag && cmd @@ -64,7 +65,7 @@ begin path.prepend(HOMEBREW_SHIMS_PATH/"shared") homebrew_path.prepend(HOMEBREW_SHIMS_PATH/"shared") - ENV["PATH"] = path + ENV["PATH"] = path.to_s require "commands" require "settings" @@ -76,7 +77,7 @@ begin homebrew_path.append(Tap.cmd_directories) # External commands expect a normal PATH - ENV["PATH"] = homebrew_path + ENV["PATH"] = homebrew_path.to_s end # Usage instructions should be displayed if and only if one of: diff --git a/Library/Homebrew/sorbet/rbi/stackprof@0.2.23.rbi b/Library/Homebrew/sorbet/rbi/stackprof@0.2.23.rbi index f6b07cc2d5..b0d22b7d39 100644 --- a/Library/Homebrew/sorbet/rbi/stackprof@0.2.23.rbi +++ b/Library/Homebrew/sorbet/rbi/stackprof@0.2.23.rbi @@ -4,6 +4,8 @@ # This is an autogenerated file for types exported from the `stackprof` gem. # Please instead update this file by running `bin/tapioca gem stackprof`. +# Note that since `stackprof` is not managed in a `Gemfile`, we can't put this in the `sorbet/rbi/gems` folder. + # source://stackprof//lib/stackprof.rb#11 module StackProf class << self