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
Discuss and setting up Style/HashAsLastArrayItem cop #199
Comments
P.S. Also right now contacts = [{contactID: 'test'}, {contactID: 'test2'}] to this one contacts = [contactID: 'test', contactID: 'test2'] which is equal But I'm going to report this issue to rubocop library P.P.S. Seems like this issue has been fixed rubocop/rubocop#8323 |
Personally, I still love |
I'm also for |
|
|
@DDKatch are you sure? in you case, you should write something like this (by this cop)
in my example above, ruby just overrides the value for |
this issue has been fixed #199 (comment) from documentation: # good
[{ one: 1 }, { two: 2 }] So I'm going to close this issue and leave |
Is your feature request related to a problem? Please describe.
Here I just want to discuss rule for this cop.
This cop sets up a rule for hash braces in the array.
EnforcedStyle: braces (default)
EnforcedStyle: no_braces (our rule)
cons of each rule on real examples:
For
braces
ruleIn the
include
blocks we need to add hash bracesUsually, I write something like this
For
no_braces
rule, usually, I faced the issue on creating an expected response for any APIInstead of writing some array which contains list of object
I need to write this variant
But if says a truth it can be really easy refactored
What do you think about it?
The text was updated successfully, but these errors were encountered: