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
# frozen_string_literal: true# newline is importantvar[1] ||= foo.map(&:bar).compact
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
You can see extension cop versions (e.g. rubocop-performance, rubocop-rails, and others) output by rubocop -V,
include them as well. Here's an example:
Fixesrubocop#309.
This PR fixes an error for `Performance/MapCompact`
when using `map(&:do_something).compact` and there is a line break after
`map.compact` and assigning with `||=`.
Expected behavior
Offence like
Actual behavior
Steps to reproduce the problem
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:You can see extension cop versions (e.g. rubocop-performance, rubocop-rails, and others) output by
rubocop -V
,include them as well. Here's an example:
The text was updated successfully, but these errors were encountered: