fables-tales / rubyfmt

Ruby Autoformatter!
MIT License
1.08k stars 50 forks source link

Empty arrays don't stay multiline when they have comments #409

Closed reese closed 1 year ago

reese commented 1 year ago

Input file

SomeObject.new(
  # arguments...
  some_array_argument: [
    # TODO
  ]
)

Rubyfmt's output

SomeObject.new(
  # arguments...
  # TODO
  some_array_argument: []
)

This is mostly a nit -- hashes do this correctly, so we should probably handle this for arrays as well.