Skip to content

Commit 17cf184

Browse files
committed
Disable Style/MapIntoArray
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.
1 parent ac2a83e commit 17cf184

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,11 @@ Style/MagicCommentFormat:
628628
Style/MapCompactWithConditionalBlock:
629629
Enabled: false
630630

631+
<% if rubocop_version >= "1.63" %>
632+
Style/MapIntoArray:
633+
Enabled: false
634+
<% end %>
635+
631636
Style/MapToHash:
632637
Enabled: false
633638

test/fixtures/full_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3229,7 +3229,7 @@ Style/MapIntoArray:
32293229
Description: Checks for usages of `each` with `<<`, `push`, or `append` which can
32303230
be replaced by `map`.
32313231
StyleGuide: "#functional-code"
3232-
Enabled: pending
3232+
Enabled: false
32333233
VersionAdded: '1.63'
32343234
Safe: false
32353235
Style/MapToHash:

0 commit comments

Comments
 (0)