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

Removal of indentation from chained method calls with blocks #261

Open
adamroyjones opened this issue Jun 12, 2021 · 0 comments
Open

Removal of indentation from chained method calls with blocks #261

adamroyjones opened this issue Jun 12, 2021 · 0 comments

Comments

@adamroyjones
Copy link

adamroyjones commented Jun 12, 2021

Thanks for your work on rufo—it's great!

I've noticed one behaviour that I find a bit surprising: when chaining method calls with blocks, indentation is removed. For example, take the following file:

Dir
  .glob("*")
  .each do |f|
    puts f
  end

With Ruby 3.0.1 and rufo 0.13.0, this becomes:

Dir
  .glob("*")
  .each do |f|
  puts f
end

In this particular case it doesn't matter at all, but for longer chains of method calls that use longer blocks, I think it becomes progressively important to let the depth of indentation correspond to the "depth" of the calls.

Do you agree with this opinion, or am I missing a reason behind the decision to remove the indentation?

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