Skip to content

Commit

Permalink
Suppress new Style/MapToSet offense
Browse files Browse the repository at this point in the history
Follow up rubocop/rubocop#11735.

This PR suppresses the following new `Style/MapToSet` offense:

```console
% bundle exec rubocop
Inspecting 115 files
............................................................C......................................................

Offenses:

spec/project_spec.rb:211:94: C: [Correctable] Style/MapToSet: Pass a block to to_set instead of calling map.to_set.
        RuboCop::Cop::Cop.registry.without_department(:Test).without_department(:Test2).cops.map(&:cop_name).to_set
                                                                                             ^^^

115 files inspected, 1 offense detected, 1 offense autocorrectable
```
  • Loading branch information
koic committed Mar 25, 2023
1 parent 0971b54 commit 8c6ed49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
end

let(:existing_cop_names) do
RuboCop::Cop::Cop.registry.without_department(:Test).without_department(:Test2).cops.map(&:cop_name).to_set
RuboCop::Cop::Cop.registry.without_department(:Test).without_department(:Test2).cops.to_set(&:cop_name)
end

let(:legacy_cop_names) do
Expand Down

0 comments on commit 8c6ed49

Please sign in to comment.