diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 8b148ee9d1..7b07c608bb 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -130,7 +130,7 @@ GEM rubocop-rspec (2.3.0) rubocop (~> 1.0) rubocop-ast (>= 1.1.0) - rubocop-sorbet (0.6.1) + rubocop-sorbet (0.6.2) rubocop ruby-macho (2.5.1) ruby-progressbar (1.11.0) diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.1.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.2.rbi similarity index 86% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.2.rbi index 7494411ca6..312d56685e 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.2.rbi @@ -1,17 +1,12 @@ # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `rubocop-sorbet` gem. -# Please instead update this file by running `tapioca sync`. +# Please instead update this file by running `bin/tapioca sync`. # typed: true -module RuboCop -end - -module RuboCop::Cop -end - -module RuboCop::Cop::Sorbet -end +module RuboCop; end +module RuboCop::Cop; end +module RuboCop::Cop::Sorbet; end class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Cop def allow_incompatible?(param0); end @@ -37,20 +32,29 @@ class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Co def using_type_alias?(param0 = T.unsafe(nil)); end end +class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop + def autocorrect(node); end + def on_send(node); end +end + +RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Sorbet::SignatureCop - include(::RuboCop::Cop::RangeHelp) + include ::RuboCop::Cop::RangeHelp def offending_node(param0); end def on_signature(node); end end +RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop def constant_from_string?(param0 = T.unsafe(nil)); end def on_send(node); end end class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil - include(::RuboCop::Cop::RangeHelp) + include ::RuboCop::Cop::RangeHelp def autocorrect(_node); end def investigate(processed_source); end @@ -62,13 +66,9 @@ class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSig end RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp) - RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp) - RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp) - RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp) - RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash) class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Sorbet::SignatureCop @@ -109,7 +109,7 @@ class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil end class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Cop - include(::RuboCop::Cop::RangeHelp) + include ::RuboCop::Cop::RangeHelp def autocorrect(node); end def extend_t_helpers?(param0 = T.unsafe(nil)); end @@ -118,7 +118,6 @@ class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Cop end RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String) - RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop @@ -132,6 +131,14 @@ end RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfSorbetDir < ::RuboCop::Cop::Cop + include ::RuboCop::Cop::RangeHelp + + def investigate(processed_source); end +end + +RuboCop::Cop::Sorbet::ForbidRBIOutsideOfSorbetDir::PATH_REGEXP = T.let(T.unsafe(nil), Regexp) + class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Cop def not_lit_const_superclass?(param0 = T.unsafe(nil)); end def on_class(node); end @@ -139,6 +146,11 @@ end RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Cop + def on_send(node); end + def t_unsafe?(param0 = T.unsafe(nil)); end +end + class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Cop def on_class(node); end def subclass_of_t_struct?(param0 = T.unsafe(nil)); end @@ -204,6 +216,7 @@ class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::Signat def node_reparsed_with_modern_features(node); end end +class RuboCop::Cop::Sorbet::SignatureBuildOrder::ModernBuilder < ::RuboCop::AST::Builder; end RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash) class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop @@ -256,20 +269,13 @@ class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop end RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp) - RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array) - RuboCop::NodePattern = RuboCop::AST::NodePattern - RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource - -module RuboCop::Sorbet -end - +module RuboCop::Sorbet; end RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash) - -class RuboCop::Sorbet::Error < ::StandardError -end +RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname) +class RuboCop::Sorbet::Error < ::StandardError; end module RuboCop::Sorbet::Inject class << self @@ -277,6 +283,6 @@ module RuboCop::Sorbet::Inject end end +RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname) RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String) - RuboCop::Token = RuboCop::AST::Token diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index f174774dbf..adf90ec3ce 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -83,7 +83,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.16.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.10.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.3.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.1/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.5.1/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.2/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/config/default.yml similarity index 84% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/config/default.yml index 50ed03d75d..8d74b1f044 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/config/default.yml @@ -14,6 +14,11 @@ Sorbet/BindingConstantWithoutTypeAlias: Enabled: true VersionAdded: 0.2.0 +Sorbet/CallbackConditionalsBinding: + Description: 'Ensures callback conditionals are bound to the right type.' + Enabled: true + VersionAdded: 0.7.0 + Sorbet/CheckedTrueInSignature: Description: 'Disallows the usage of `checked(true)` in signatures.' Enabled: true @@ -42,7 +47,7 @@ Sorbet/FalseSigil: Description: 'All files must be at least at strictness `false`.' Enabled: true VersionAdded: 0.3.3 - SuggestedStrictness: true + SuggestedStrictness: "false" Include: - "**/*.rb" - "**/*.rbi" @@ -60,6 +65,13 @@ Sorbet/ForbidExtendTSigHelpersInShims: Include: - "**/*.rbi" +Sorbet/ForbidRBIOutsideOfSorbetDir: + Description: 'Forbids RBI files outside of the sorbet/ directory.' + Enabled: true + VersionAdded: 0.6.1 + Include: + - "**/*.rbi" + Sorbet/ForbidIncludeConstLiteral: Description: 'Forbids include of non-literal constants.' Enabled: false @@ -74,6 +86,12 @@ Sorbet/ForbidSuperclassConstLiteral: Exclude: - db/migrate/*.rb +Sorbet/ForbidTUnsafe: + Description: 'Forbid usage of T.unsafe.' + Enabled: false + VersionAdded: 0.7.0 + VersionChanged: 0.7.0 + Sorbet/ForbidUntypedStructProps: Description: >- Disallows use of `T.untyped` or `T.nilable(T.untyped)` as a @@ -84,11 +102,14 @@ Sorbet/ForbidUntypedStructProps: Sorbet/HasSigil: Description: 'Makes the Sorbet typed sigil mandatory in all files.' Enabled: false + SuggestedStrictness: "false" + MinimumStrictness: "false" VersionAdded: 0.3.3 Sorbet/IgnoreSigil: Description: 'All files must be at least at strictness `ignore`.' Enabled: false + SuggestedStrictness: "ignore" VersionAdded: 0.3.3 Sorbet/KeywordArgumentOrdering: @@ -131,19 +152,25 @@ Sorbet/SingleLineRbiClassModuleDefinitions: Sorbet/StrictSigil: Description: 'All files must be at least at strictness `strict`.' Enabled: false + SuggestedStrictness: "strict" VersionAdded: 0.3.3 Sorbet/StrongSigil: Description: 'All files must be at least at strictness `strong`.' Enabled: false + SuggestedStrictness: "strong" VersionAdded: 0.3.3 Sorbet/TrueSigil: Description: 'All files must be at least at strictness `true`.' Enabled: false + SuggestedStrictness: "true" VersionAdded: 0.3.3 Sorbet/ValidSigil: Description: 'All files must have a valid sigil.' Enabled: true + RequireSigilOnAllFiles: false + SuggestedStrictness: "false" + MinimumStrictness: "false" VersionAdded: 0.3.3 diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop-sorbet.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop-sorbet.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop-sorbet.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop-sorbet.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb new file mode 100644 index 0000000000..e692fe347c --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Sorbet + # This cop ensures that callback conditionals are bound to the right type + # so that they are type checked properly. + # + # @example + # + # # bad + # class Post < ApplicationRecord + # before_create :do_it, if: -> { should_do_it? } + # + # def should_do_it? + # true + # end + # end + # + # # good + # class Post < ApplicationRecord + # before_create :do_it, if: -> { T.bind(self, Post).should_do_it? } + # + # def should_do_it? + # true + # end + # end + class CallbackConditionalsBinding < RuboCop::Cop::Cop + CALLBACKS = %i( + validate + validates + validates_with + before_validation + around_validation + + before_create + before_save + before_destroy + before_update + + after_create + after_save + after_destroy + after_update + after_touch + after_initialize + after_find + + around_create + around_save + around_destroy + around_update + + before_commit + + after_commit + after_create_commit + after_destroy_commit + after_rollback + after_save_commit + after_update_commit + + before_action + prepend_before_action + append_before_action + + around_action + prepend_around_action + append_around_action + + after_action + prepend_after_action + append_after_action + ).freeze + + def autocorrect(node) + lambda do |corrector| + options = node.each_child_node.find(&:hash_type?) + + conditional = nil + options.each_pair do |keyword, block| + if keyword.value == :if || keyword.value == :unless + conditional = block + break + end + end + + _, _, block = conditional.child_nodes + expected_class = node.parent_module_name + + bind = if block.begin_type? + indentation = " " * block.child_nodes.first.loc.column + "T.bind(self, #{expected_class})\n#{indentation}" + elsif block.child_nodes.empty? && !block.ivar_type? + "T.bind(self, #{expected_class})." + else + "T.bind(self, #{expected_class}); " + end + + corrector.insert_before(block, bind) + end + end + + def on_send(node) + return unless CALLBACKS.include?(node.method_name) + + options = node.each_child_node.find(&:hash_type?) + return if options.nil? + + conditional = nil + options.each_pair do |keyword, block| + next unless keyword.sym_type? + + if keyword.value == :if || keyword.value == :unless + conditional = block + break + end + end + + return if conditional.nil? || conditional.child_nodes.empty? + + type, _, block = conditional.child_nodes + return unless type.lambda_or_proc? + + expected_class = node.parent_module_name + return if expected_class.nil? + + unless block.source.include?("T.bind(self, #{expected_class})") + add_offense( + node, + message: "Callback conditionals should be bound to the right type. Use T.bind(self, #{expected_class})" + ) + end + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/constants_from_strings.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/constants_from_strings.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/constants_from_strings.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/constants_from_strings.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb new file mode 100644 index 0000000000..5e10cdd8a6 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'rubocop' + +module RuboCop + module Cop + module Sorbet + # This cop disallows using `T.unsafe` anywhere. + # + # @example + # + # # bad + # T.unsafe(foo) + # + # # good + # foo + class ForbidTUnsafe < RuboCop::Cop::Cop + def_node_matcher(:t_unsafe?, '(send (const nil? :T) :unsafe _)') + + def on_send(node) + add_offense(node, message: "Do not use `T.unsafe`.") if t_unsafe?(node) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_extend_t_sig_helpers_in_shims.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/forbid_extend_t_sig_helpers_in_shims.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_sorbet_dir.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_sorbet_dir.rb new file mode 100644 index 0000000000..6932a58e3f --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_sorbet_dir.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Sorbet + # This cop makes sure that RBI files are always located under sorbet/rbi/. + # + # @example + # # bad + # lib/some_file.rbi + # other_file.rbi + # + # # good + # sorbet/rbi/some_file.rbi + # sorbet/rbi/any/path/for/file.rbi + class ForbidRBIOutsideOfSorbetDir < RuboCop::Cop::Cop + include RangeHelp + + PATH_REGEXP = %r{sorbet/rbi} + + def investigate(processed_source) + add_offense( + nil, + location: source_range(processed_source.buffer, 1, 0), + message: "RBI files are only accepted in the sorbet/rbi/ directory." + ) unless processed_source.file_path =~ PATH_REGEXP + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/single_line_rbi_class_module_definitions.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/single_line_rbi_class_module_definitions.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/false_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/false_sigil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/false_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/false_sigil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/has_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/has_sigil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/has_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/has_sigil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/true_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/true_sigil.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/true_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/true_sigil.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb index fbcc307ba4..f7b93c3004 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb @@ -147,12 +147,14 @@ module RuboCop # Default is `'false'` def suggested_strictness - STRICTNESS_LEVELS.include?(cop_config['SuggestedStrictness']) ? cop_config['SuggestedStrictness'] : 'false' + config = cop_config['SuggestedStrictness'].to_s + STRICTNESS_LEVELS.include?(config) ? config : 'false' end # Default is `nil` def minimum_strictness - cop_config['MinimumStrictness'] if STRICTNESS_LEVELS.include?(cop_config['MinimumStrictness']) + config = cop_config['MinimumStrictness'].to_s + config if STRICTNESS_LEVELS.include?(config) end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/parameters_ordering_in_signature.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/parameters_ordering_in_signature.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/parameters_ordering_in_signature.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/parameters_ordering_in_signature.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/signature_cop.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/signature_cop.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet/signatures/signature_cop.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet/signatures/signature_cop.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet_cops.rb similarity index 78% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet_cops.rb index ae9006a095..6e6906249d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/cop/sorbet_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/cop/sorbet_cops.rb @@ -1,12 +1,16 @@ # frozen_string_literal: true require_relative 'sorbet/binding_constants_without_type_alias' require_relative 'sorbet/constants_from_strings' -require_relative 'sorbet/forbid_extend_t_sig_helpers_in_shims' require_relative 'sorbet/forbid_superclass_const_literal' require_relative 'sorbet/forbid_include_const_literal' require_relative 'sorbet/forbid_untyped_struct_props' -require_relative 'sorbet/single_line_rbi_class_module_definitions' require_relative 'sorbet/one_ancestor_per_line' +require_relative 'sorbet/callback_conditionals_binding' +require_relative 'sorbet/forbid_t_unsafe' + +require_relative 'sorbet/rbi/forbid_extend_t_sig_helpers_in_shims' +require_relative 'sorbet/rbi/forbid_rbi_outside_of_sorbet_dir' +require_relative 'sorbet/rbi/single_line_rbi_class_module_definitions' require_relative 'sorbet/signatures/allow_incompatible_override' require_relative 'sorbet/signatures/checked_true_in_signature' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet/version.rb similarity index 76% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet/version.rb index 95e81d1189..1fa2887aeb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.1/lib/rubocop/sorbet/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-sorbet-0.6.2/lib/rubocop/sorbet/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module RuboCop module Sorbet - VERSION = "0.6.1" + VERSION = "0.6.2" end end