You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this might be similar to #8409, but the reverse. When EnforcedStyle is no_braces, Style/HashAsLastArrayItem is a bit over-zealous IMO when it comes to an array of only hashes, and suggests removing the outer braces for the last element, which is going to lead to confusion.
Can the cop be updated to not consider arrays that are only hashes?
Expected behavior
Cop should not find any offense with this code with EnforcedStyle: no_braces:
I believe this might be similar to #8409, but the reverse. When
EnforcedStyle
isno_braces
,Style/HashAsLastArrayItem
is a bit over-zealous IMO when it comes to an array of only hashes, and suggests removing the outer braces for the last element, which is going to lead to confusion.Can the cop be updated to not consider arrays that are only hashes?
Expected behavior
Cop should not find any offense with this code with
EnforcedStyle: no_braces
:Actual behavior
The cop registers offenses for the outer braces on the last element, and autocorrects them away:
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: