From 7224ff5f7734c936d695c4a452fd29d61e2bc2ec Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 24 Apr 2023 19:13:49 -0700 Subject: [PATCH] Include T::Sig in Module --- Library/Homebrew/extend/module.rb | 2 ++ Library/Homebrew/global.rb | 2 +- Library/Homebrew/rubocops.rb | 1 + Library/Homebrew/sorbet/parlour.rb | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/module.rb b/Library/Homebrew/extend/module.rb index b09433b483..62b97c2b01 100644 --- a/Library/Homebrew/extend/module.rb +++ b/Library/Homebrew/extend/module.rb @@ -2,6 +2,8 @@ # frozen_string_literal: true class Module + include T::Sig + def attr_rw(*attrs) attrs.each do |attr| module_eval <<-EOS, __FILE__, __LINE__+1 diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 071eba618a..27f2015451 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -72,6 +72,7 @@ HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze +require "extend/module" require "env_config" require "macos_versions" require "os" @@ -134,7 +135,6 @@ require "extend/array" require "git_repository" require "extend/pathname" require "extend/predicable" -require "extend/module" require "cli/args" require "PATH" diff --git a/Library/Homebrew/rubocops.rb b/Library/Homebrew/rubocops.rb index 3e5daa64c3..187b692368 100644 --- a/Library/Homebrew/rubocops.rb +++ b/Library/Homebrew/rubocops.rb @@ -2,5 +2,6 @@ # frozen_string_literal: true require_relative "standalone" +require_relative "extend/module" require "rubocops/all" diff --git a/Library/Homebrew/sorbet/parlour.rb b/Library/Homebrew/sorbet/parlour.rb index 102df89819..52abedb103 100644 --- a/Library/Homebrew/sorbet/parlour.rb +++ b/Library/Homebrew/sorbet/parlour.rb @@ -1,6 +1,7 @@ # typed: true # frozen_string_literal: true +require_relative "../extend/module" require_relative "../warnings" Warnings.ignore :parser_syntax do require "parser/current"