Enable types in remaining untyped extensions

This commit is contained in:
Douglas Eichelberger 2023-04-02 12:20:53 -07:00
parent 6397229f68
commit 0079cefc95
4 changed files with 15 additions and 16 deletions

View File

@ -1,14 +1,11 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew
extend T::Sig extend T::Sig
module_function
class << self class << self
alias generic_git_tags git_tags alias generic_git_tags git_tags
end
def git_tags def git_tags
tags = generic_git_tags tags = generic_git_tags
@ -16,3 +13,4 @@ module Homebrew
tags tags
end end
end end
end

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
require "tempfile" require "tempfile"
@ -46,7 +46,7 @@ module Homebrew
f.write "#!/bin/sh\n" f.write "#!/bin/sh\n"
f.chmod 0700 f.chmod 0700
f.close f.close
return if system f.path return if system T.must(f.path)
<<~EOS <<~EOS
The directory #{HOMEBREW_TEMP} does not permit executing The directory #{HOMEBREW_TEMP} does not permit executing
@ -56,12 +56,12 @@ module Homebrew
echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile} echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile}
EOS EOS
ensure ensure
f.unlink f&.unlink
end end
def check_xdg_data_dirs def check_xdg_data_dirs
return if ENV["XDG_DATA_DIRS"].blank? xdg_data_dirs = ENV["XDG_DATA_DIRS"]
return if ENV["XDG_DATA_DIRS"].split("/").include?(HOMEBREW_PREFIX/"share") return if xdg_data_dirs.blank? || xdg_data_dirs.split("/").include?(HOMEBREW_PREFIX/"share")
<<~EOS <<~EOS
Homebrew's share was not found in your XDG_DATA_DIRS but you have Homebrew's share was not found in your XDG_DATA_DIRS but you have

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
module Hardware module Hardware
@ -111,6 +111,7 @@ module Hardware
end end
%w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag| %w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag|
T.bind(self, T.class_of(Hardware::CPU))
define_method("#{flag}?") { flags.include? flag } define_method("#{flag}?") { flags.include? flag }
end end

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew
@ -379,7 +379,7 @@ module Homebrew
real_tmp = tmp.realpath.parent real_tmp = tmp.realpath.parent
where_tmp = volumes.which real_tmp where_tmp = volumes.which real_tmp
ensure ensure
Dir.delete tmp Dir.delete tmp.to_s
end end
rescue rescue
return return