-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use mixin instead of superclass for signature cops #183
Conversation
fc7959d
to
686171c
Compare
@@ -93,11 +93,11 @@ def check_node(node) | |||
end | |||
|
|||
def param_type_placeholder | |||
cop_config["ParameterTypePlaceholder"] || "T.untyped" | |||
cop_config["ParameterTypePlaceholder"] || "T.untyped" # rubocop:todo InternalAffairs/UndefinedConfig |
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.
Due to a bug, it doesn't seem possible to make this cop pass, so I'm disabling it inline.
#184 will disable it entirely until the bug is fixed, at which point we can address all the offenses.
require "rubocop" | ||
require_relative "signature_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.
Cops shouldn't need to require rubocop
or any mixins, as those should already be required by lib/rubocop-sorbet.rb
and lib/rubocop/cop/sorbet_cops.rb
, respectively.
715b4b2
to
e3a2905
Compare
# | ||
# | ||
class SignatureBuildOrder < ::RuboCop::Cop::Cop # rubocop:todo InternalAffairs/InheritDeprecatedCopClass |
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.
This cop is currently undocumented. Without the empty comments, YARD uses the rubocop:disable
comment as documentation, which makes it into manual/cops_sorbet.md
. Adding these explicitly provides empty documentation, which maintains the status quo, as documenting it is out of scope of this PR.
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.
Turns out this approach didn't work, and neither did the other things I tried, so I just documented it in #186.
e3a2905
to
677f62b
Compare
677f62b
to
b47599d
Compare
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.
Let's rebase this on top of #184 to avoid all the disable comments?
Right, I did intend to do that. 👍 This PR branches off #186. If we can get that in first, I can do it in a single rebase. |
b47599d
to
2643055
Compare
This approach - matches what RuboCop does internally, - avoids the need to override the registry (?), and - allows granularly migrating from the deprecated `Cop` class to `Base`.
2643055
to
f1502f0
Compare
@Morriar I've rebased and removed the |
This replaces the
SignatureCop
parent class with aSignatureHelp
mixin module. SinceSignatureCop
was inheriting from the deprecatedRuboCop::Cop::Cop
, the cops that were inheriting fromSignatureCop
are updated to inherit directly fromCop
instead.This approach
Cop
class toBase
.Before Merging
SignatureBuildOrder
cop #186 is merged