Skip to content

Commit

Permalink
Merge pull request #18102 from Homebrew/requires_ancestor
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid authored Aug 21, 2024
2 parents f827410 + 6db4ed2 commit d5b7de5
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 75 deletions.
4 changes: 4 additions & 0 deletions Library/Homebrew/cask/staged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
module Cask
# Helper functions for staged casks.
module Staged
extend T::Helpers

requires_ancestor { Kernel }

# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) }
Expand Down
7 changes: 0 additions & 7 deletions Library/Homebrew/cask/staged.rbi

This file was deleted.

4 changes: 4 additions & 0 deletions Library/Homebrew/dependencies_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

# Helper functions for dependencies.
module DependenciesHelpers
extend T::Helpers

requires_ancestor { Kernel }

def args_includes_ignores(args)
includes = [:required?, :recommended?] # included by default
includes << :build? if args.include_build?
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/dependencies_helpers.rbi

This file was deleted.

3 changes: 3 additions & 0 deletions Library/Homebrew/formula_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module Homebrew
# Helper functions available in formula `test` blocks.
module Assertions
include Context
extend T::Helpers

requires_ancestor { Kernel }

require "minitest"
require "minitest/assertions"
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/formula_assertions.rbi

This file was deleted.

1 change: 1 addition & 0 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module FormulaCellarChecks
extend T::Helpers

abstract!
requires_ancestor { Kernel }

sig { abstract.returns(Formula) }
def formula; end
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/formula_cellar_checks.rbi

This file was deleted.

4 changes: 4 additions & 0 deletions Library/Homebrew/language/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def self.local_npm_install_args

# Mixin module for {Formula} adding shebang rewrite features.
module Shebang
extend T::Helpers

requires_ancestor { Formula }

module_function

# A regex to match potential shebang permutations.
Expand Down
9 changes: 0 additions & 9 deletions Library/Homebrew/language/node.rbi

This file was deleted.

4 changes: 4 additions & 0 deletions Library/Homebrew/language/perl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ module Language
module Perl
# Helper module for replacing `perl` shebangs.
module Shebang
extend T::Helpers

requires_ancestor { Formula }

module_function

# A regex to match potential shebang permutations.
Expand Down
9 changes: 0 additions & 9 deletions Library/Homebrew/language/perl.rbi

This file was deleted.

8 changes: 8 additions & 0 deletions Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ def self.setup_install_args(prefix, python = "python3")

# Mixin module for {Formula} adding shebang rewrite features.
module Shebang
extend T::Helpers

requires_ancestor { Formula }

module_function

# A regex to match potential shebang permutations.
Expand Down Expand Up @@ -144,6 +148,10 @@ def detected_python_shebang(formula = T.cast(self, Formula), use_python_from_pat

# Mixin module for {Formula} adding virtualenv support features.
module Virtualenv
extend T::Helpers

requires_ancestor { Formula }

# Instantiates, creates and yields a {Virtualenv} object for use from
# {Formula#install}, which provides helper methods for instantiating and
# installing packages into a Python virtualenv.
Expand Down
11 changes: 0 additions & 11 deletions Library/Homebrew/language/python.rbi

This file was deleted.

2 changes: 2 additions & 0 deletions Library/Homebrew/unpack_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module UnpackStrategy
include SystemCommand::Mixin
abstract!

requires_ancestor { Kernel }

# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
UnpackStrategyType = T.type_alias { T.all(T::Class[UnpackStrategy], UnpackStrategy::ClassMethods) }
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/unpack_strategy.rbi

This file was deleted.

3 changes: 3 additions & 0 deletions Library/Homebrew/utils/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module Utils
module Curl
include SystemCommand::Mixin
extend SystemCommand::Mixin
extend T::Helpers

requires_ancestor { Kernel }

# Error returned when the server sent data curl could not parse.
CURL_WEIRD_SERVER_REPLY_EXIT_CODE = 8
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/utils/curl.rbi

This file was deleted.

4 changes: 4 additions & 0 deletions Library/Homebrew/utils/shebang.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
module Utils
# Helper functions for manipulating shebang lines.
module Shebang
extend T::Helpers

requires_ancestor { Kernel }

module_function

# Specification on how to rewrite a given shebang.
Expand Down
7 changes: 0 additions & 7 deletions Library/Homebrew/utils/shebang.rbi

This file was deleted.

4 changes: 4 additions & 0 deletions Library/Homebrew/utils/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

module Utils
module Shell
extend T::Helpers

requires_ancestor { Kernel }

module_function

# Take a path and heuristically convert it to a shell name,
Expand Down
7 changes: 0 additions & 7 deletions Library/Homebrew/utils/shell.rbi

This file was deleted.

0 comments on commit d5b7de5

Please sign in to comment.