diff --git a/Library/Homebrew/cask/staged.rb b/Library/Homebrew/cask/staged.rb index 83f2da1415430..c358581e0945e 100644 --- a/Library/Homebrew/cask/staged.rb +++ b/Library/Homebrew/cask/staged.rb @@ -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)]) } diff --git a/Library/Homebrew/cask/staged.rbi b/Library/Homebrew/cask/staged.rbi deleted file mode 100644 index ddf5f8cdbcc0f..0000000000000 --- a/Library/Homebrew/cask/staged.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Cask - module Staged - include Kernel - end -end diff --git a/Library/Homebrew/dependencies_helpers.rb b/Library/Homebrew/dependencies_helpers.rb index 989fdc43eaeaa..ab4241484159c 100644 --- a/Library/Homebrew/dependencies_helpers.rb +++ b/Library/Homebrew/dependencies_helpers.rb @@ -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? diff --git a/Library/Homebrew/dependencies_helpers.rbi b/Library/Homebrew/dependencies_helpers.rbi deleted file mode 100644 index f2226a40f4044..0000000000000 --- a/Library/Homebrew/dependencies_helpers.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module DependenciesHelpers - include Kernel -end diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index f0562fe33a06c..ed24d9d1b5957 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -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" diff --git a/Library/Homebrew/formula_assertions.rbi b/Library/Homebrew/formula_assertions.rbi deleted file mode 100644 index 3e752629399d6..0000000000000 --- a/Library/Homebrew/formula_assertions.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module Homebrew::Assertions - include Kernel -end diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 17f642b17a766..45973181e7631 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -8,6 +8,7 @@ module FormulaCellarChecks extend T::Helpers abstract! + requires_ancestor { Kernel } sig { abstract.returns(Formula) } def formula; end diff --git a/Library/Homebrew/formula_cellar_checks.rbi b/Library/Homebrew/formula_cellar_checks.rbi deleted file mode 100644 index 7e451676f975d..0000000000000 --- a/Library/Homebrew/formula_cellar_checks.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module FormulaCellarChecks - include Kernel -end diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb index c89aab812047c..de08fffd4aecd 100644 --- a/Library/Homebrew/language/node.rb +++ b/Library/Homebrew/language/node.rb @@ -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. diff --git a/Library/Homebrew/language/node.rbi b/Library/Homebrew/language/node.rbi deleted file mode 100644 index 15faf4a5c61b7..0000000000000 --- a/Library/Homebrew/language/node.rbi +++ /dev/null @@ -1,9 +0,0 @@ -# typed: strict - -module Language - module Node - module Shebang - include Kernel - end - end -end diff --git a/Library/Homebrew/language/perl.rb b/Library/Homebrew/language/perl.rb index d69b2c8e953d1..4c08aef894b9b 100644 --- a/Library/Homebrew/language/perl.rb +++ b/Library/Homebrew/language/perl.rb @@ -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. diff --git a/Library/Homebrew/language/perl.rbi b/Library/Homebrew/language/perl.rbi deleted file mode 100644 index 9be98f1896413..0000000000000 --- a/Library/Homebrew/language/perl.rbi +++ /dev/null @@ -1,9 +0,0 @@ -# typed: strict - -module Language - module Perl - module Shebang - include Kernel - end - end -end diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index ae6cbaf7def40..3f97088eb16e5 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -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. @@ -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. diff --git a/Library/Homebrew/language/python.rbi b/Library/Homebrew/language/python.rbi deleted file mode 100644 index ab011b8db7311..0000000000000 --- a/Library/Homebrew/language/python.rbi +++ /dev/null @@ -1,11 +0,0 @@ -# typed: strict - -module Language::Python - module Shebang - include Kernel - end - - module Virtualenv - requires_ancestor { Formula } - end -end diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index 382e82533dbc0..aadd9535c6c2a 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -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) } diff --git a/Library/Homebrew/unpack_strategy.rbi b/Library/Homebrew/unpack_strategy.rbi deleted file mode 100644 index d7550c56b299f..0000000000000 --- a/Library/Homebrew/unpack_strategy.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module UnpackStrategy - include Kernel -end diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 2c70ba34a5d2b..967e3af7597b9 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -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 diff --git a/Library/Homebrew/utils/curl.rbi b/Library/Homebrew/utils/curl.rbi deleted file mode 100644 index 0f6a0b720568e..0000000000000 --- a/Library/Homebrew/utils/curl.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strict - -module Utils::Curl - include Kernel -end diff --git a/Library/Homebrew/utils/shebang.rb b/Library/Homebrew/utils/shebang.rb index 93df6425b1e66..bdbe99ac3ef57 100644 --- a/Library/Homebrew/utils/shebang.rb +++ b/Library/Homebrew/utils/shebang.rb @@ -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. diff --git a/Library/Homebrew/utils/shebang.rbi b/Library/Homebrew/utils/shebang.rbi deleted file mode 100644 index 9cdb0b2007155..0000000000000 --- a/Library/Homebrew/utils/shebang.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Utils - module Shebang - include Kernel - end -end diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index cff179c2feaef..a621fbff8d480 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -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, diff --git a/Library/Homebrew/utils/shell.rbi b/Library/Homebrew/utils/shell.rbi deleted file mode 100644 index b860bc1190ed9..0000000000000 --- a/Library/Homebrew/utils/shell.rbi +++ /dev/null @@ -1,7 +0,0 @@ -# typed: strict - -module Utils - module Shell - include Kernel - end -end