Skip to content
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

Conditions shouldn't need to be on the same line as a statement-modifier #1016

Closed
stouset opened this issue Apr 18, 2014 · 1 comment
Closed

Comments

@stouset
Copy link

stouset commented Apr 18, 2014

Rubocop currently warns about this construct ("Place the condition on the same line as if"):

do_the_thing if
  some_condition && some_other_condition

Is there any reason why we should discourage putting the conditional on a newline in this case? In the event that either the conditional or the statement is long, this allows breaking it onto multiple lines.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 18, 2014

This is a bug. The check is meant for scenarios like:

if
something
do_something
end

I've never seen anyone write intentionally code like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants