Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is in Rubocop v1.10 rubocop/rubocop#9478
It seems like the intention is to prevent
Hash[ary]
and to encourageary.to_h
instead. But this also sweeps up every use ofHash[]
. We have had thatHash[]
call in specs we generated for Hanami 1.3 apps. I'd like to see that continue when we do Hanami 2.0 generators.I personally much prefer
Hash[]
particularly when it's in a block. The squiqqly braces mean two different things in Ruby: a hash literal or a block. By avoiding using them as hash literal, it make its clear that they're used for blocks most often. (I'm not a purist about this, I just think it's easier to read often. With nested hashes, I often resort to hash literals inside aHash[]
call.)