diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index c4749280a2..e9bfd35bd9 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -60,10 +60,10 @@ module SharedEnvExtension end private :reset - sig { returns(T::Hash[String, String]) } + sig { returns(T::Hash[String, T.nilable(String)]) } def remove_cc_etc keys = %w[CC CXX OBJC OBJCXX LD CPP CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS] - keys.to_h { |key| [key, T.must(delete(key))] } + keys.to_h { |key| [key, delete(key)] } end sig { params(newflags: String).void } diff --git a/Library/Homebrew/rubocops/cask/extend/node.rbi b/Library/Homebrew/rubocops/cask/extend/node.rbi index f3db682720..d5850b29bd 100644 --- a/Library/Homebrew/rubocops/cask/extend/node.rbi +++ b/Library/Homebrew/rubocops/cask/extend/node.rbi @@ -1,11 +1,8 @@ # typed: strict class RuboCop::AST::Node - sig { returns(T::Boolean) } - def arch_variable?; end - - sig { returns(T::Boolean) } - def begin_block?; end + sig { returns(T.nilable(RuboCop::AST::SendNode)) } + def method_node; end sig { returns(T.nilable(RuboCop::AST::Node)) } def block_body; end @@ -13,9 +10,12 @@ class RuboCop::AST::Node sig { returns(T::Boolean) } def cask_block?; end - sig { returns(T.nilable(RuboCop::AST::Node)) } - def method_node; end - sig { returns(T::Boolean) } def on_system_block?; end + + sig { returns(T::Boolean) } + def arch_variable?; end + + sig { returns(T::Boolean) } + def begin_block?; end end diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.60.2.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.60.2.rbi index 60d86eb255..86b12d92ac 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.60.2.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.60.2.rbi @@ -41602,7 +41602,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-sorbet/0.7.6/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 + # source://rubocop-sorbet/0.7.7/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 def on_assignment(value); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#127 @@ -41620,7 +41620,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#217 def splat_value(param0 = T.unsafe(nil)); end - # source://rubocop-sorbet/0.7.6/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 + # source://rubocop-sorbet/0.7.7/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 def t_let(param0 = T.unsafe(nil)); end private diff --git a/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb b/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb index d1c1b5934a..da03f37a3b 100644 --- a/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb +++ b/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb @@ -24,9 +24,9 @@ module Tapioca # exclude vendored code, to avoid contradicting their RBI files !path.include?("/vendor/bundle/ruby/") && # exclude source code that already has an RBI file - !Pathname("#{path}i").exist? && + !File.exist?("#{path}i") && # exclude source code that doesn't use the DSLs - File.readlines(path).grep(/def_node_/).any? + File.readlines(path).any?(/def_node_/) end end @@ -40,7 +40,8 @@ module Tapioca # https://github.com/rubocop/rubocop-ast/blob/master/lib/rubocop/ast/node_pattern.rb # https://github.com/rubocop/rubocop-ast/blob/master/lib/rubocop/ast/node_pattern/method_definer.rb # The type signatures below could maybe be stronger, but I only wanted to avoid errors: - if source.start_with?("def_node_matcher") + case source + when /\Adef_node_matcher/ # https://github.com/Shopify/tapioca/blob/3341a9b/lib/tapioca/rbi_ext/model.rb#L89 klass.create_method( method_name.to_s, @@ -51,7 +52,7 @@ module Tapioca ], return_type: "T.untyped", ) - elsif source.start_with?("def_node_search") + when /\Adef_node_search/ klass.create_method( method_name.to_s, parameters: [