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

Avoid horizontal alignment pattern #288

Open
dongcheolpark opened this issue Jan 25, 2023 · 4 comments
Open

Avoid horizontal alignment pattern #288

dongcheolpark opened this issue Jan 25, 2023 · 4 comments

Comments

@dongcheolpark
Copy link

dongcheolpark commented Jan 25, 2023

Hi guys,

this is my code.

return some_method(param: {
  first: 'first',
  second: { second_first: {}, second_second: {} }
})

I'd like to format my code as follows: 

return some_method(param: {
  first: 'first',
  second: {
    second_first: {},
    second_second: {}
  }
})

or

return some_method(
  param: {
    first: 'first',
    second: {
      second_first: {},
      second_second: {}
    }
  })

but rufo make code like this:

return some_method(param: {
                     first: 'first',
                     second: {
                       second_first: {},
                       second_second: {},
                     },
                   })

I can't find any configuration to avoid this pattern.

Do guys Have plan implement this feature?

@dongcheolpark dongcheolpark changed the title Avoid Horizontal Alignment Pattern Avoid horizontal alignment pattern Jan 25, 2023
@kzkn
Copy link
Member

kzkn commented Jan 29, 2023

I think Rufo should behaves as unobtrusive by default. So in this case, I think the expected output of Rufo is

return some_method(param: {
  first: 'first',
  second: {
    second_first: {},
    second_second: {}
  }
})

@dongcheolpark
Copy link
Author

thank you for your comment.
but rufo act like this:

image

is this bug or feature?

@kzkn
Copy link
Member

kzkn commented Jan 30, 2023

I can't say it is a bug, but it is a point that could be improved through discussion. I think a variety of test cases would help the discussion.

@manuraj17
Copy link

I vote for this

return some_method(
  param: {
    first: 'first',
    second: {
      second_first: {},
      second_second: {}
    }
  })

It's what I follow but I feel that is against the gem's vision :D

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

3 participants