Skip to content

Commit

Permalink
Disable Style/MapIntoArray
Browse files Browse the repository at this point in the history
While preferring `.map { ... }` vs `a = []; b.each { a << ... }` makes
sense, this cop has lots of gotchas, so we'll probably have to evaluate
it's false positive rate to determine if we should enable it or not.
  • Loading branch information
sambostock committed Apr 9, 2024
1 parent ac2a83e commit 17cf184
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions rubocop.yml
Expand Up @@ -628,6 +628,11 @@ Style/MagicCommentFormat:
Style/MapCompactWithConditionalBlock:
Enabled: false

<% if rubocop_version >= "1.63" %>
Style/MapIntoArray:
Enabled: false
<% end %>

Style/MapToHash:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/full_config.yml
Expand Up @@ -3229,7 +3229,7 @@ Style/MapIntoArray:
Description: Checks for usages of `each` with `<<`, `push`, or `append` which can
be replaced by `map`.
StyleGuide: "#functional-code"
Enabled: pending
Enabled: false
VersionAdded: '1.63'
Safe: false
Style/MapToHash:
Expand Down

0 comments on commit 17cf184

Please sign in to comment.