Skip to content

Commit

Permalink
Fix registry deprecation notice (Shopify#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 authored Jul 11, 2024
1 parent 276c4cd commit 4ab4032
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/sorbet/sigils/has_sigil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Sorbet
#
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
class HasSigil < ValidSigil
@registry = Cop.registry # So we can properly subclass this cop
@registry = Registry.global # So we can properly subclass this cop

def require_sigil_on_all_files?
true
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/sorbet/sigils/valid_sigil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Sorbet
# If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
# Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
class ValidSigil < RuboCop::Cop::Cop # rubocop:todo InternalAffairs/InheritDeprecatedCopClass
@registry = Cop.registry # So we can properly subclass this cop
@registry = Registry.global # So we can properly subclass this cop

def investigate(processed_source)
return if processed_source.tokens.empty?
Expand Down
4 changes: 2 additions & 2 deletions tasks/cops_documentation.rake
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ task generate_cops_documentation: :yard_for_generate_documentation do
end

def main
cops = RuboCop::Cop::Cop.registry
cops = RuboCop::Cop::Registry.global
config = RuboCop::ConfigLoader.load_file("config/default.yml")

YARD::Registry.load!
Expand All @@ -302,7 +302,7 @@ task documentation_syntax_check: :yard_for_generate_documentation do

ok = true
YARD::Registry.load!
cops = RuboCop::Cop::Cop.registry
cops = RuboCop::Cop::Registry.global
cops.each do |cop|
examples = YARD::Registry.all(:class).find do |code_object|
next unless RuboCop::Cop::Badge.for(code_object.to_s) == cop.badge
Expand Down

0 comments on commit 4ab4032

Please sign in to comment.