Skip to content

Commit

Permalink
Improve Style/SymbolProc about #10810 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
r7kamura committed Jul 13, 2022
1 parent 8d484e3 commit b05e98f
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 b05e98f

Please sign in to comment.