-
Notifications
You must be signed in to change notification settings - Fork 31
Introduce MultipleTEnumValues
cop
#224
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
Conversation
012b6b0
to
3805c79
Compare
def after_class(node) | ||
@scopes.pop if t_enum?(node) | ||
end |
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.
Which case does this cover?
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 covers the case where two T::Enum
classes are nested together. It's not a pattern I've seen, but it is technically possible.
Example:
class Enum1 < T::Enum # @scopes = [Enum1]
class Enum2 < T::Enum # @scopes = [Enum1, Enum2]
...
end # @scopes = [Enum1]
end # @scopes = []
86a7724
to
f01193b
Compare
This cop ensures that all `T::Enum`s have at least two values to limit unnecessary uses of `T::Enum`. Co-authored-by: Stan Lo <stan.lo@shopify.com>
f01193b
to
24c7e88
Compare
Related to #219.
This cop ensures that all
T::Enum
s have at least two values to limit unnecessary uses ofT::Enum
.