Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more typing #15033

Merged
merged 1 commit into from Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Library/Homebrew/keg.rb
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

require "keg_relocate"
Expand Down Expand Up @@ -524,8 +524,8 @@ def optlink(verbose: false, dry_run: false, overwrite: false)
end

def delete_pyc_files!
find { |pn| pn.delete if PYC_EXTENSIONS.include?(pn.extname) }
find { |pn| FileUtils.rm_rf pn if pn.basename.to_s == "__pycache__" }
path.find { |pn| pn.delete if PYC_EXTENSIONS.include?(pn.extname) }
path.find { |pn| FileUtils.rm_rf pn if pn.basename.to_s == "__pycache__" }
end

def binary_executable_or_library_files
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/mktemp.rb
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

# Performs {Formula#mktemp}'s functionality, and tracks the results.
Expand Down Expand Up @@ -70,7 +70,7 @@ def run
begin
chown(nil, group_id, @tmpdir)
rescue Errno::EPERM
opoo "Failed setting group \"#{Etc.getgrgid(group_id).name}\" on #{@tmpdir}"
opoo "Failed setting group \"#{T.must(Etc.getgrgid(group_id)).name}\" on #{@tmpdir}"
end

begin
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/options.rb
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

# A formula option.
Expand Down
8 changes: 8 additions & 0 deletions Library/Homebrew/options.rbi
@@ -0,0 +1,8 @@
# typed: strict

class Options
# This is a workaround to enable `alias to_ary to_a`
# @see https://github.com/sorbet/sorbet/issues/2378#issuecomment-569474238
sig { returns(T::Array[Option]) }
def to_a; end
end
2 changes: 1 addition & 1 deletion Library/Homebrew/os/linux/elf.rb
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

# {Pathname} extension for dealing with ELF files.
Expand Down
5 changes: 5 additions & 0 deletions Library/Homebrew/os/linux/elf.rbi
@@ -0,0 +1,5 @@
# typed: strict

module ELFShim
requires_ancestor { Pathname }
end
2 changes: 1 addition & 1 deletion Library/Homebrew/os/mac/mach.rb
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true

require "macho"
Expand Down
5 changes: 5 additions & 0 deletions Library/Homebrew/os/mac/mach.rbi
@@ -0,0 +1,5 @@
# typed: strict

module MachOShim
include Kernel
end