-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
EmptyLines removes empty lines from heredoc strings #815
Comments
I cannot reproduce this. What version of RuboCop are you using? |
rubocop (0.18.1) |
|
Ah, yes. Adding the |
Seems that the tokens in the source are mixed up, which is causing the problem. The newline on the first line appear in the token stream just before the tokens of |
I guess this is not a Parser bug. The @ngan's source: str = <<-TEXT
line 1
line 2
TEXT
puts str is tokenized as:
However, we can parenthesize heredocs like this: puts(<<-TEXT)
line 1
line 2
TEXT
puts 'foo' and its tokens are:
I think this is natural order.
I think so. Or ignore line numbers that are less than the max line number seen so far. |
Not sure if this is a bug or feature, but the EmptyLines cop seems to not like blank lines in heredoc strings.
The text was updated successfully, but these errors were encountered: