Merge pull request #13216 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-sorbet-0.6.8

build(deps): bump rubocop-sorbet from 0.6.7 to 0.6.8 in /Library/Homebrew
This commit is contained in:
Mike McQuaid 2022-04-29 14:34:39 +01:00 committed by GitHub
commit ea722400cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 57 additions and 6 deletions

View File

@ -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)

View File

@ -20,7 +20,8 @@ class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Co
def autocorrect(node); end
def binding_unaliased_type?(param0 = T.unsafe(nil)); end
def dynamic_type_creation_with_block?(param0 = T.unsafe(nil)); end
def generic_parameter_decl?(param0 = T.unsafe(nil)); end
def generic_parameter_decl_block_call?(param0 = T.unsafe(nil)); end
def generic_parameter_decl_call?(param0 = T.unsafe(nil)); end
def method_needing_aliasing_on_t?(param0); end
def not_dynamic_type_creation_with_block?(node); end
def not_generic_parameter_decl?(node); end
@ -192,6 +193,14 @@ class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::Si
def check_order_for_kwoptargs(parameters); end
end
module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
def on_assignment(value); end
class << self
def prepended(base); end
end
end
class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop
def abstract?(param0); end
def autocorrect(node); end

View File

@ -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

View File

@ -88,7 +88,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.27.0/lib"
$:.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"

View File

@ -57,12 +57,18 @@ module RuboCop
)
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
@ -81,7 +87,7 @@ module RuboCop
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)

View File

@ -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
)

View File

@ -28,3 +28,5 @@ require_relative "sorbet/sigils/strict_sigil"
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"

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
module RuboCop
module Sorbet
VERSION = "0.6.7"
VERSION = "0.6.8"
end
end