rufo
rufo copied to clipboard
Wrong indentation for literal array with interpolation at the beginning of a string
RuFo 0.7.0 Ruby 2.4.6
RuFo is behaving weirdly on literal arrays with interpolation at the beginning of a string. See this for example:
test = %W[
#{a}test
]
Running RuFo on it will format to:
test = %W[
#{a}test
]
Running RuFo again will format to:
test = %W[
#{a}test
]
The interpolation has to be at the beginning of the string.
test = %W[
test
#{a}test
test#{a}
test#{a}test
]
Will format to:
test = %W[
test
#{a}test
test#{a}
test#{a}test
]
puts :foo, bar: {
baz: :qux,
}
Also needs two runs to indent, which means rufo . && rufo --check will fail.
puts :foo, bar: {
baz: :qux,
}
puts :foo, bar: {
baz: :qux,
}