-
Notifications
You must be signed in to change notification settings - Fork 193
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
Rubocop: Your move, Creep #1283
Conversation
class Learning | ||
class App | ||
include TextPlugin::App | ||
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.
This seems to break the tests, cause Learning is a module
not a class :)
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.
Thanks :P
when Empty, Continue | ||
else @line = "" | ||
end | ||
@line = "" unless e == Empty || e == Continue |
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.
TBH this seems wrong?! o_O Imo it should be Empty === e
if we wanted to literally translate the case statement to an if. I'd be shocked to find such a big bug in rubocop though.
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.
Rubocop was complaining about the empty when
, but I made the change here - we're through all the auto-correctable cops now. I wasn't sure about this change though, so I mentioned it in the PR comments. Thanks for catching that I should have used ===
. How do you want this to look though, would this be better?
@line = "" unless [Empty, Continue].include?(e.class)
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 we really need an is_a?
check to work with subclassing but yes something else would be better than currently :)
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.
LGTM in general, there is the test failure and the (imo) wrong conversion of the empty when conversion...
@@ -17,7 +17,7 @@ def _position(left, top) | |||
gui.update_position if gui && gui.respond_to?(:update_position) | |||
end | |||
|
|||
# displace(left: a number, top: a number) » self | |||
# displace(left: a number, top: a number) >> self |
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.
👍
@@ -38,8 +38,10 @@ | |||
|
|||
# move the @comp paddle, speed based on `compuspeed` variable | |||
@comp.left += | |||
if nx + (ball_diameter / 2) > @comp.left + paddle_size; compuspeed | |||
elsif nx < @comp.left; -compuspeed |
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.
wow that was ugly :D
4b7caf0
to
0a22f90
Compare
Rubocop bumms out...
I guess we could substitute it through an |
OK, used |
Thank you! |
Low hanging rubocop fixes for #945
I’m not 100% sure on the Lint/EmptyWhen fix if someone can double check that, I’d appreciate it.