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

Disabling BracesAroundHashParameters when second to last param is also a hash #801

Closed
stopdropandrew opened this issue Feb 7, 2014 · 3 comments

Comments

@stopdropandrew
Copy link

In our rails tests, we often have

get :index, { param: 'something' }, { session_value: 'abcd' }

Rubocop wants us to remove the final arguments curly braces, resulting in

get :index, { param: 'something' }, session_value: 'abcd'

To me, using curly braces in this case more clearly states the intention of which key/value pairs are in each hash.

Is this something that people would like to see, or is it too specific a case?

@mikegee
Copy link
Contributor

mikegee commented Feb 14, 2014

I agree with your preference to include the braces around both hashes.

On the other hand, I almost always avoid this situation by assigning the two hashes to local variables.

@mockdeep
Copy link
Contributor

mockdeep commented Apr 8, 2014

Kind of agree with this one. I just went through and removed them for now, but it's nice to show hashes as being distinct arguments.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 8, 2014

I'm OK with having this as an option, so I guess one of you can implement it.

bbatsov added a commit that referenced this issue Nov 8, 2014
[Fix #801] Add a `depending` style to BracesAroundHashParameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants