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

Hash Literals with a space #26

Closed
david-pm opened this issue Nov 20, 2018 · 5 comments
Closed

Hash Literals with a space #26

david-pm opened this issue Nov 20, 2018 · 5 comments

Comments

@david-pm
Copy link

First off, this library is a great idea!
Now for the complaints:

foo = { bar: "baz" }

Layout/SpaceInsideHashLiteralBraces: Space inside } detected.

I just can't live with: {bar: "baz"}. Just look at it. I know Rails is not the gospel or anything but it is probably Ruby's most read codebase, and I only see hash literals with the space in there.

@twe4ked
Copy link
Contributor

twe4ked commented Nov 21, 2018

One argument against having spaces is that they clearly distinguish hashes from blocks.

@searls
Copy link
Contributor

searls commented Nov 21, 2018 via email

@noelrappin
Copy link

I very much use the "space for blocks, no space for hashes rule" and would like to see it be part of standard.

@searls
Copy link
Contributor

searls commented Nov 28, 2018

The yea's have it. Thanks for raising this, though, @david-pm!

@donapieppo
Copy link

donapieppo commented Jun 28, 2023

In ruby 3 docs class Hash we have

h = {foo: 0, bar: 1, baz: 2}

while in ruby 2 docs class Hash we had

options = { font_size: 10, font_family: "Arial" }

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

5 participants