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

multiline indent for Style/WordArray and Style/SymbolArray autocorrect #5409

Closed
flyerhzm opened this issue Jan 6, 2018 · 0 comments
Closed

Comments

@flyerhzm
Copy link
Contributor

flyerhzm commented Jan 6, 2018

For multiline word array and symbol array autocorrect

Expected behavior

it expects to keep the original indent.

Actual behavior

it removes original indent.

Steps to reproduce the problem

$ cat test.rb
 [
   "foo",
   "bar",
   "baz"
 ]

 [
   :foo,
   :bar,
   :baz
 ]
$ rubocop -a --only Style/WordArray,Style/SymbolArray ./test.rb
$ cat test.rb
 %w[
foo.
bar.
baz]

 %i[
foo.
bar.
baz]

But I expect the code to be

%w[
  foo
  bar
  baz
]

%i[
  foo
  bar
  baz
]

RuboCop version

$ rubocop -V
0.52.1 (using Parser 2.4.0.2, running on ruby 2.4.3 x86_64-darwin17)
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

1 participant