Skip to content

Commit

Permalink
Merge pull request #13216 from Homebrew/dependabot/bundler/Library/Ho…
Browse files Browse the repository at this point in the history
…mebrew/rubocop-sorbet-0.6.8

build(deps): bump rubocop-sorbet from 0.6.7 to 0.6.8 in /Library/Homebrew
  • Loading branch information
MikeMcQuaid committed Apr 29, 2022
2 parents 2c0bd31 + 00909fc commit ea72240
Show file tree
Hide file tree
Showing 39 changed files with 57 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ GEM
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.10.0)
rubocop (~> 1.19)
rubocop-sorbet (0.6.7)
rubocop-sorbet (0.6.8)
rubocop (>= 0.90.0)
ruby-macho (3.0.0)
ruby-progressbar (1.11.0)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -5239,6 +5239,11 @@ class RuboCop::Cop::FormulaCop
def required_dependency_name?(param0, param1); end
end

class RuboCop::Cop::Style::MutableConstant
include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
def t_let(param0=T.unsafe(nil)); end
end

module RuboCop::RSpec::ExpectOffense
def expect_correction(correction, loop: T.unsafe(nil), source: T.unsafe(nil)); end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/vendor/bundle/bundler/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.13.3/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.14.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.10.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.7/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.8/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov_json_formatter-0.1.4/lib"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ class BindingConstantWithoutTypeAlias < RuboCop::Cop::Cop
)
PATTERN

def_node_matcher(:generic_parameter_decl?, <<-PATTERN)
def_node_matcher(:generic_parameter_decl_call?, <<-PATTERN)
(
send nil? {:type_template :type_member} ...
)
PATTERN

def_node_matcher(:generic_parameter_decl_block_call?, <<-PATTERN)
(block
(send nil? {:type_template :type_member}) ...
)
PATTERN

def_node_search(:method_needing_aliasing_on_t?, <<-PATTERN)
(
send
Expand All @@ -81,7 +87,7 @@ def not_dynamic_type_creation_with_block?(node)
end

def not_generic_parameter_decl?(node)
!generic_parameter_decl?(node)
!generic_parameter_decl_call?(node) && !generic_parameter_decl_block_call?(node)
end

def not_nil?(node)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

require "rubocop/cop/style/mutable_constant"

module RuboCop
module Cop
module Sorbet
module MutableConstantSorbetAwareBehaviour
def self.prepended(base)
base.def_node_matcher(:t_let, <<~PATTERN)
(send (const nil? :T) :let $_constant _type)
PATTERN
end

def on_assignment(value)
t_let(value) do |constant|
value = constant
end

super(value)
end
end
end
end
end

RuboCop::Cop::Style::MutableConstant.prepend(
RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@
require_relative "sorbet/sigils/strong_sigil"
require_relative "sorbet/sigils/enforce_sigil_order"
require_relative "sorbet/sigils/enforce_single_sigil"

require_relative "sorbet/mutable_constant_sorbet_aware_behaviour"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module RuboCop
module Sorbet
VERSION = "0.6.7"
VERSION = "0.6.8"
end
end

0 comments on commit ea72240

Please sign in to comment.