Fix strict typecheck errors.
This commit is contained in:
parent
f7492c0a54
commit
55dc8bbada
@ -4,6 +4,8 @@
|
||||
class Cleaner
|
||||
private
|
||||
|
||||
extend T::Sig
|
||||
sig { params(path: Pathname).returns(T.nilable(T::Boolean)) }
|
||||
def executable_path?(path)
|
||||
path.elf? || path.text_executable?
|
||||
end
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module FormulaCellarChecks
|
||||
extend T::Sig
|
||||
sig { params(filename: Pathname).returns(T::Boolean) }
|
||||
def valid_library_extension?(filename)
|
||||
generic_valid_library_extension?(filename) || filename.basename.to_s.include?(".so.")
|
||||
end
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class BottleSpecification
|
||||
extend T::Sig
|
||||
sig { returns(T::Boolean) }
|
||||
def skip_relocation?
|
||||
false
|
||||
end
|
||||
|
||||
@ -4,12 +4,15 @@
|
||||
module Utils
|
||||
module Analytics
|
||||
class << self
|
||||
extend T::Sig
|
||||
sig { returns(String) }
|
||||
def formula_path
|
||||
return generic_formula_path if Homebrew::EnvConfig.force_homebrew_on_linux?
|
||||
|
||||
"formula-linux"
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def analytics_path
|
||||
return generic_analytics_path if Homebrew::EnvConfig.force_homebrew_on_linux?
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class KegOnlyReason
|
||||
extend T::Sig
|
||||
sig { returns(T::Boolean) }
|
||||
def applicable?
|
||||
true
|
||||
end
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Hardware
|
||||
extend T::Sig
|
||||
sig { params(version: T.nilable(Version)).returns(Symbol) }
|
||||
def self.oldest_cpu(version = MacOS.version)
|
||||
if CPU.arch == :arm64
|
||||
:arm_vortex_tempest
|
||||
|
||||
@ -8,7 +8,10 @@ require "cask/caskroom"
|
||||
|
||||
module Homebrew
|
||||
module MissingFormula
|
||||
extend T::Sig
|
||||
class << self
|
||||
extend T::Sig
|
||||
sig { params(name: String).returns(T.nilable(String)) }
|
||||
def disallowed_reason(name)
|
||||
case name.downcase
|
||||
when "xcode"
|
||||
@ -33,12 +36,14 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
sig { params(name: String, silent: T::Boolean, show_info: T::Boolean).returns(T.nilable(String)) }
|
||||
def cask_reason(name, silent: false, show_info: false)
|
||||
return if silent
|
||||
|
||||
suggest_command(name, show_info ? "info" : "install")
|
||||
end
|
||||
|
||||
sig { params(name: String, command: String).returns(T.nilable(String)) }
|
||||
def suggest_command(name, command)
|
||||
suggestion = <<~EOS
|
||||
Found a cask named "#{name}" instead. Try
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
module Utils
|
||||
module Analytics
|
||||
class << self
|
||||
extend T::Sig
|
||||
sig { returns(String) }
|
||||
def custom_prefix_label
|
||||
"non-/usr/local"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user