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

Chained method call with block is split too soon #929

Closed
ryanb opened this issue Jul 26, 2021 · 2 comments · Fixed by #974
Closed

Chained method call with block is split too soon #929

ryanb opened this issue Jul 26, 2021 · 2 comments · Fixed by #974

Comments

@ryanb
Copy link

ryanb commented Jul 26, 2021

Metadata

  • Operating system: Mac OS X 11.4
  • Ruby version: 2.5.5
  • Node version: 16.4.2
  • @prettier/plugin-ruby or prettier gem version: 1.6.1

Input

this.is.the.first.line do
  this.is.the.second.line do
    puts 'Hello World'
    puts 'Goodbye World'
  end
end

Current output

this
  .is
  .the
  .first
  .line do
    this
      .is
      .the
      .second
      .line do
        puts 'Hello World'
        puts 'Goodbye World'
      end
  end

Expected output

this.is.the.first.line do
  this.is.the.second.line do
    puts 'Hello World'
    puts 'Goodbye World'
  end
end

The input looks good to me. None of the lines are close to the 80 character width. I find the current output more difficult to read.

@kddnewton
Copy link
Member

Oof yeah should definitely be what you expect. I'll take a look!

@davidvalaz
Copy link

davidvalaz commented Sep 19, 2021

Just wanting to +1 this.

Metadata

  • Operating system: Mac OS X 11.6
  • Ruby version: 3.0.0p0
  • Node version: 16.9.1
  • @prettier/plugin-ruby or prettier gem version: 1.6.1

Input

Rails.application.routes.draw do
  root 'articles#index'

  resources :articles
end

Output

Rails
  .application
  .routes
  .draw do
    root 'articles#index'

    resources :articles
  end

Expected output

Rails.application.routes.draw do
  root 'articles#index'

  resources :articles
end

kddnewton added a commit that referenced this issue Sep 29, 2021
@kddnewton kddnewton mentioned this issue Sep 29, 2021
kddnewton added a commit that referenced this issue Sep 29, 2021
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

Successfully merging a pull request may close this issue.

3 participants