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

Bug: Rufo breaks HEREDOC syntax #88

Closed
ivoanjo opened this issue Mar 4, 2018 · 2 comments
Closed

Bug: Rufo breaks HEREDOC syntax #88

ivoanjo opened this issue Mar 4, 2018 · 2 comments
Labels

Comments

@ivoanjo
Copy link

ivoanjo commented Mar 4, 2018

While looking into #83 I tried rufo on a number of repositories for commonly-used gems and came across a few issues.

This one is a testcase extracted from the pry gem.

Example code:

puts (<<-HELLO
  hello world
HELLO
)

which after running rufo turns into

puts (<<-HELLO
  hello world
HELLO)

which is now invalid:

$ ruby heredoc.rb 
heredoc.rb:3: can't find string "HELLO" anywhere before EOF
heredoc.rb:1: syntax error, unexpected end-of-input, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
puts (<<-HELLO
              ^
@gingermusketeer
Copy link
Member

Thanks for reporting this ❤️. I have a failing test for this issue here https://github.com/ruby-formatter/rufo/compare/chore/fix-heredoc-issue

@mjago
Copy link
Member

mjago commented Jul 27, 2018

Fixed with #116

@mjago mjago closed this as completed Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants