Skip to content

Commit

Permalink
Let’s see if these come back with green Sorbet?
Browse files Browse the repository at this point in the history
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 22, 2024
1 parent 404666b commit 26c6d5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Library/Homebrew/cask/migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def migrate(dry_run: false)
old_caskroom_path = old_cask.caskroom_path
new_caskroom_path = new_cask.caskroom_path

return if (old_caskfile = old_cask.installed_caskfile).nil?
old_caskfile = old_cask.installed_caskfile
return if old_caskfile.nil?

old_installed_caskfile = old_caskfile.relative_path_from(old_caskroom_path)
new_installed_caskfile = old_installed_caskfile.dirname/old_installed_caskfile.basename.sub(
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ def relative_glob(dir, pattern)
File.directory?(dir) ? Dir.chdir(dir) { Dir[pattern] } : []
end

sig { params(file: T.any(Pathname, String), objdump: String).returns(T::Boolean) }
def cpuid_instruction?(file, objdump = "objdump")
@instruction_column_index ||= T.let({}, T.nilable(T::Hash[String, T.untyped]))
sig { params(file: T.any(Pathname, String), objdump: Pathname).returns(T::Boolean) }
def cpuid_instruction?(file, objdump)
@instruction_column_index ||= T.let({}, T.nilable(T::Hash[String, Integer]))
@instruction_column_index[objdump] ||= begin
objdump_version = Utils.popen_read(objdump, "--version")

Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Help
cmd: T.nilable(String),
empty_argv: T::Boolean,
usage_error: T.nilable(String),
remaining_args: T.nilable(T::Array[String])
remaining_args: T::Array[String])
).void
}
def self.help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: [])
Expand Down Expand Up @@ -51,7 +51,7 @@ def self.help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: []
params(
cmd: String,
path: Pathname,
remaining_args: T.nilable(T::Array[String]),
remaining_args: T::Array[String],
).returns(String)
}
def self.command_help(cmd, path, remaining_args:)
Expand All @@ -76,7 +76,7 @@ def self.command_help(cmd, path, remaining_args:)
sig {
params(
path: Pathname,
remaining_args: T.nilable(T::Array[String])
remaining_args: T::Array[String]
).returns(T.nilable(String))
}
def self.parser_help(path, remaining_args:)
Expand All @@ -91,12 +91,12 @@ def self.parser_help(path, remaining_args:)
end
private_class_method :parser_help

sig { params(path: Pathname).returns(T::Array[T.nilable(String)]) }
sig { params(path: Pathname).returns(T::Array[String]) }
def self.command_help_lines(path)
path.read
.lines
.grep(/^#:/)
.map { |line| line.slice(2..-1)&.delete_prefix(" ") }
.filter_map { |line| line.slice(2..-1)&.delete_prefix(" ") }
end
private_class_method :command_help_lines

Expand Down

0 comments on commit 26c6d5a

Please sign in to comment.