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

Rubocop not working in if expression. #332

Open
ryush00 opened this issue Nov 7, 2023 · 0 comments
Open

Rubocop not working in if expression. #332

ryush00 opened this issue Nov 7, 2023 · 0 comments

Comments

@ryush00
Copy link

ryush00 commented Nov 7, 2023

Hello,

The code in the if statement is not properly Rubocop linted. Since it's splitting the code into multiple lines to run ruby-parse, it doesn't seem to lint correctly if the end code is on a different line, like an if statement.

I have tested with this method.

<!-- test.html.erb -->
<% if I18n.locale=='ko' %>
    test
<% else %>
    test2
<% end %>
@diagnostics=[#<Parser::Diagnostic:0x00007f06724512d8
@level=:error,
@reason=:unexpected_token,
@arguments={:token=>"$end"},
@location=#<Parser::Source::Range /workspace/app/views/application/test.html.erb 23...23>, @highlights=[]>]

I think it can also occur on multi-line cause. (including Block, Proc, Lambda)

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

1 participant