-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix #11732] Make Style/MapToHash
and Style/MapToSet
aware of symbol proc
#11735
Merged
bbatsov
merged 1 commit into
rubocop:master
from
koic:make_style_map_to_hash_and_map_to_set_aware_of_symbol_proc
Mar 25, 2023
Merged
[Fix #11732] Make Style/MapToHash
and Style/MapToSet
aware of symbol proc
#11735
bbatsov
merged 1 commit into
rubocop:master
from
koic:make_style_map_to_hash_and_map_to_set_aware_of_symbol_proc
Mar 25, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… of symbol proc Fixes rubocop#11732. This PR makes `Style/MapToHash` and `Style/MapToSet` aware of symbol proc.
Nice! |
koic
deleted the
make_style_map_to_hash_and_map_to_set_aware_of_symbol_proc
branch
March 25, 2023 06:33
koic
added a commit
to rubocop/rubocop-rails
that referenced
this pull request
Mar 25, 2023
Follow up rubocop/rubocop#11735. This PR suppresses the following new `Style/MapToSet` offense: ```console % bundle exec rubocop (snip) Offenses: spec/project_spec.rb:213: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 ^^^ 279 files inspected, 1 offense detected, 1 offense autocorrectable ```
koic
added a commit
to rubocop/rubocop-performance
that referenced
this pull request
Mar 25, 2023
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 ```
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this pull request
Mar 26, 2023
I noticed it when working on rubocop#11735. This PR makes `Style/MapToHash` and `Style/MapToSet` aware of numbered parameters.
koic
added a commit
to rubocop/rubocop-ast
that referenced
this pull request
Mar 27, 2023
Follow up rubocop/rubocop#11735. This PR suppresses the following new `Style/MapToSet` offense: ```console % bundle exec rubocop (snip) Offenses: lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb:41:33: C: [Correctable] Style/MapToSet: Pass a block to to_set instead of calling map.to_set. set = node.children.map(&:child).to_set.freeze ^^^ 163 files inspected, 1 offense detected, 1 offense autocorrectable ```
MarttiCheng
added a commit
to MarttiCheng/Rubocop-Performance
that referenced
this pull request
Sep 28, 2023
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 ```
SerhiiMisiura
added a commit
to SerhiiMisiura/Rubocop-Performance
that referenced
this pull request
Oct 5, 2023
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 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11732.
This PR makes
Style/MapToHash
andStyle/MapToSet
aware of symbol proc.Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.