Merge pull request #15033 from dduugg/enable-types

Enable more typing
This commit is contained in:
Mike McQuaid 2023-03-22 13:30:08 +00:00 committed by GitHub
commit dea9da6139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
require "keg_relocate" require "keg_relocate"
@ -524,8 +524,8 @@ class Keg
end end
def delete_pyc_files! def delete_pyc_files!
find { |pn| pn.delete if PYC_EXTENSIONS.include?(pn.extname) } path.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| FileUtils.rm_rf pn if pn.basename.to_s == "__pycache__" }
end end
def binary_executable_or_library_files def binary_executable_or_library_files

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
# Performs {Formula#mktemp}'s functionality, and tracks the results. # Performs {Formula#mktemp}'s functionality, and tracks the results.
@ -70,7 +70,7 @@ class Mktemp
begin begin
chown(nil, group_id, @tmpdir) chown(nil, group_id, @tmpdir)
rescue Errno::EPERM 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 end
begin begin

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
# A formula option. # A formula option.

View File

@ -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

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
# {Pathname} extension for dealing with ELF files. # {Pathname} extension for dealing with ELF files.

View File

@ -0,0 +1,5 @@
# typed: strict
module ELFShim
requires_ancestor { Pathname }
end

View File

@ -1,4 +1,4 @@
# typed: false # typed: true
# frozen_string_literal: true # frozen_string_literal: true
require "macho" require "macho"

View File

@ -0,0 +1,5 @@
# typed: strict
module MachOShim
include Kernel
end