ruby-syntax-tree / syntax_tree

Interact with the Ruby syntax tree

Home Page:https://ruby-syntax-tree.github.io/syntax_tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array with block requires formatting twice

ryanb opened this issue · comments

Given the following Ruby code.

["fooooooooooooooooooooooooooooooooo", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar"].map.with_index { |token, index| puts "Foo" }

Running the formatter once produces this.

%w[fooooooooooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar].map
  .with_index { |token, index| puts "Foo" }

Running it again produces this.

%w[fooooooooooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar]
  .map
  .with_index { |token, index| puts "Foo" }

This is with the default settings (80 line width).