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

Method chain ending with block always breaks on multiple lines due to argument #445

Open
rafbm opened this issue Mar 22, 2024 · 0 comments

Comments

@rafbm
Copy link

rafbm commented Mar 22, 2024

This remains as-is:

foo.bar.each do |item|
  line_one(item)
  line_two(item)
end

But this…

foo.bar(1).each do |item|
  line_one(item)
  line_two(item)
end

…gets turned into:

foo
  .bar(1)
  .each do |item|
    line_one(item)
    line_two(item)
  end

If there’s no chaining, it remains as-is:

foo(1).each do |item|
  line_one(item)
  line_two(item)
end

More or less reminiscent of prettier/plugin-ruby#729.

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