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

rule suggestion hash inside array #4286

Closed
mockdeep opened this issue Apr 19, 2017 · 4 comments · Fixed by #8271
Closed

rule suggestion hash inside array #4286

mockdeep opened this issue Apr 19, 2017 · 4 comments · Fixed by #8271
Labels
feature request style guide Requires update(s) to the Ruby Style Guide weird ruby

Comments

@mockdeep
Copy link
Contributor

When a ruby hash is the last item in an array, we can use the same shorthand syntax as for method calls. It would be nice to have a linter to enforce one style or another:

# braces
my_array = ['foo', 'bar', { baz: 'butz' }]

# no_braces
my_array = ['foo', 'bar', baz: 'butz']
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 18, 2018

We should also add a rule about this in the style guide. I definitely think the preferred practice should be to use curly braces.

@bbatsov bbatsov added the style guide Requires update(s) to the Ruby Style Guide label Sep 19, 2018
@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label May 8, 2019
@stale
Copy link

stale bot commented Jun 7, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Jun 7, 2019
@ZimbiX
Copy link

ZimbiX commented Jun 11, 2019

Unless this has been resolved without my knowledge, please re-open the issue

@bbatsov bbatsov reopened this Jul 8, 2020
@stale stale bot removed the stale Issues that haven't been active in a while label Jul 8, 2020
@koic koic closed this as completed in #8271 Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request style guide Requires update(s) to the Ruby Style Guide weird ruby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants