-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix registry deprecation notice #240
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the right approach would be to migrate to RuboCop::Cop::Base
. See https://docs.rubocop.org/rubocop/v1_upgrade_notes.html.
@sambostock started the transition with #143.
0acec34
to
ab4676a
Compare
Started work on moving to |
@andyw8 If you don't mind, I can open a PR to migrate to the V1 API for |
Follow up Shopify#240 (comment). The legacy `Cop::Cop` API is deprecated and this PR use new `Cop::Base` API instead. > maintain any RuboCop extensions, as the legacy API will be removed in RuboCop 2.0. https://metaredux.com/posts/2020/10/21/rubocop-1-0.html
935bdf7
to
ab4676a
Compare
Thanks. I've reset this branch to contain only the |
Follow up Shopify#240 (comment). The legacy `Cop::Cop` API is deprecated and this PR use new `Cop::Base` API instead. > maintain any RuboCop extensions, as the legacy API will be removed in RuboCop 2.0. https://metaredux.com/posts/2020/10/21/rubocop-1-0.html
Follow up #240 (comment). The legacy `Cop::Cop` API is deprecated and this PR use new `Cop::Base` API instead. > maintain any RuboCop extensions, as the legacy API will be removed in RuboCop 2.0. https://metaredux.com/posts/2020/10/21/rubocop-1-0.html
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this even meaningful anymore? The comment seems to indicate that subclasses would not inherit the @registry
instance variable and would thus break Cop.registry
for subclass. Since we are moving to Registry.global
, it feels like this should no longer be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Closes #238