Skip to content

Commit

Permalink
Merge pull request #10815 from r7kamura/feature/improve-10810
Browse files Browse the repository at this point in the history
Improve `Style/SymbolProc` about #10810 changes
  • Loading branch information
koic committed Jul 14, 2022
2 parents 8d484e3 + b05e98f commit 0266f1c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog/change_support_csend_on_stylesymbolproc.md
@@ -1 +1 @@
* [#10810](https://github.com/rubocop/rubocop/pull/10810): Support `csend` on `Style/SymbolProc`. ([@r7kamura][])
* [#10810](https://github.com/rubocop/rubocop/pull/10810): Support safe navigation operator on `Style/SymbolProc`. ([@r7kamura][])
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/symbol_proc.rb
Expand Up @@ -89,7 +89,7 @@ class SymbolProc < Base
def_node_matcher :proc_node?, '(send (const {nil? cbase} :Proc) :new)'

# @!method symbol_proc_receiver?(node)
def_node_matcher :symbol_proc_receiver?, '{({csend | send} ...) (super ...) zsuper}'
def_node_matcher :symbol_proc_receiver?, '{(call ...) (super ...) zsuper}'

# @!method symbol_proc?(node)
def_node_matcher :symbol_proc?, <<~PATTERN
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/style/symbol_proc_spec.rb
Expand Up @@ -12,7 +12,7 @@
RUBY
end

it 'registers an offense for csend' do
it 'registers an offense for safe navigation operator' do
expect_offense(<<~RUBY)
coll&.map { |e| e.upcase }
^^^^^^^^^^^^^^^^ Pass `&:upcase` as an argument to `map` instead of a block.
Expand Down

0 comments on commit 0266f1c

Please sign in to comment.