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

Wrong indentation for literal array with interpolation at the beginning of a string #179

Open
pmk1c opened this issue Jun 18, 2019 · 1 comment

Comments

@pmk1c
Copy link

pmk1c commented Jun 18, 2019

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
]
@pmk1c pmk1c closed this as completed Jun 19, 2019
@pmk1c pmk1c reopened this Jun 19, 2019
@ssendev
Copy link

ssendev commented Sep 12, 2019

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,
           }

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

2 participants