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

Ruby not formatted if it opens a block #136

Open
pelletencate opened this issue Feb 25, 2023 · 0 comments
Open

Ruby not formatted if it opens a block #136

pelletencate opened this issue Feb 25, 2023 · 0 comments

Comments

@pelletencate
Copy link

pelletencate commented Feb 25, 2023

Environment:

  • Prettier 2.2.0
  • prettier-plugin-ruby: 1.5.5
  • prettier-plugin-erb: 0.4.0

NOTE: If this bug is ancient and has been fixed upstream in something that requires #49 to be resolved, please close this.

Steps to reproduce:

  • Set printWidth to 60
  • Try to format the following ERB
<% my_awesome_command :this, :list, %i[of arguments is], intentionally: :longer, than: 60.characters %>

<% my_awesome_block_command :but, :when, %i[it takes a block], it: :just, doesnt: :want, to: :format do %>
  <h1>And that's probably a bug.</h1>
<% end %>

Observed

<%
  my_awesome_command :this,
                     :list,
                     %i[of arguments is],
                     intentionally: :longer,
                     than: 60.characters
%>

<% my_awesome_block_command :but, :when, %i[it takes a block], it: :just, doesnt: :want, to: :format do %>
  <h1>And that's probably a bug.</h1>
<% end %>

Expected

I suppose something like:

<%
  my_awesome_command :this,
                     :list,
                     %i[of arguments is],
                     intentionally: :longer,
                     than: 60.characters
%>

<%
  my_awesome_block_command :but,
                           :when,
                           %i[it takes a block],
                           it: :just,
                           doesnt: :want,
                           to: :format do
%>
  <h1>And that's probably a bug.</h1>
<% end %>
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