fables-tales/rubyfmt

`.squish` in SQL heredocs is moved to the closing SQL statement

Closed this issue · 1 comments

pjg commented
  • Ruby version: 3.1.4p223
  • Rubyfmt git sha: rubyfmt-main 0.10.0 (installed via brew)

The cop: RuboCop::Cop::Rails::SquishedSQLHeredocs

Input file

<<~SQL.squish
  SELECT ...
SQL      

Rubyfmt's output

<<~SQL
  SELECT ...
SQL
  .squish

This breaks because

Not exactly a "break" per se, but the .squish call is moved into a weird place, which results in a code, which is weirdly idented/formatted.

I am not sure if this is only (a/my) style preference or rather incorrect rubyfmt behaviour, which should be fixed. I won't be posting such issues if it's the former.

I think Rubyfmt does the right thing here