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

Error with multiline ternary operators #4794

Closed
jrmhaig opened this issue Sep 26, 2017 · 1 comment · Fixed by #4934
Closed

Error with multiline ternary operators #4794

jrmhaig opened this issue Sep 26, 2017 · 1 comment · Fixed by #4934
Labels

Comments

@jrmhaig
Copy link

jrmhaig commented Sep 26, 2017

Expected behavior

Describe here how you expected RuboCop to behave in this particular situation.

With this sample code:

one ||
  two ? 3 : 5

Rubocop should report the offence with multi-line ternary operators according to the configuration.

Actual behavior

The offence is reported correctly but with an error:

1 error occurred:
An error occurred while Layout/MultilineOperationIndentation cop was inspecting /Users/jrmhaig/workspace/rubocop_test/test.rb:1:0.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
Mention the following information in the issue report:
0.50.0 (using Parser 2.4.0.0, running on ruby 2.4.1 x86_64-darwin16)
Finished in 0.12138300016522408 seconds

Steps to reproduce the problem

Create a file test.rb containing:

one ||
  two ? 3 : 5

and execute Rubocop.

RuboCop version

Include the output of rubocop -V. Here's an example:

$ rubocop -V
0.50.0 (using Parser 2.4.0.0, running on ruby 2.4.1 x86_64-darwin16)
@rrosenblum
Copy link
Contributor

I think I have a fix for this. I will try to create a PR soon. I need to go over some other test cases.

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