Skip to content

Removal of indentation from chained method calls with blocks #261

@adamroyjones

Description

@adamroyjones

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions