-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
BreakNode / ReturnNode / NextNode: Multiple fixes #71
Conversation
Alternative would be to have My first impression is that while |
278dc0d
to
4dee1c2
Compare
4dee1c2
to
4be151d
Compare
Methods were returning nonsense (e.g. receiver, method_name, ...)
4be151d
to
31a147d
Compare
Generally, when I made these decisions, the starting point was always in RuboCop itself. I would notice that for some cops it would be useful to have polymorphism between e.g. |
Sorry if I wasn't clear: Not so for |
I'm okay with us being pragmatic about it, and not making it polymorphic until that seems useful. That approach has worked well until now. 🙂 |
This PR:
return
by not includingMethodDispatchNode
(since it is not a method dispatch). Most methods would return nonsense (e.g.method_call
could benil
or whatever the second argument was)break
, plus fixes argument handlingNextNode
next
,break
andreturn
are very similar, the only difference being how far back they leave the current scope.