Skip to content

Commit 40edcae

Browse files
committed
Use call instead of {send csend} for def_node_matcher
1 parent 17ebff7 commit 40edcae

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/rubocop/cop/rails/index_by.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ class IndexBy < Base
2323

2424
def_node_matcher :on_bad_each_with_object, <<~PATTERN
2525
(block
26-
({send csend} _ :each_with_object (hash))
26+
(call _ :each_with_object (hash))
2727
(args (arg $_el) (arg _memo))
28-
({send csend} (lvar _memo) :[]= $!`_memo (lvar _el)))
28+
(call (lvar _memo) :[]= $!`_memo (lvar _el)))
2929
PATTERN
3030

3131
def_node_matcher :on_bad_to_h, <<~PATTERN
3232
(block
33-
({send csend} _ :to_h)
33+
(call _ :to_h)
3434
(args (arg $_el))
3535
(array $_ (lvar _el)))
3636
PATTERN
3737

3838
def_node_matcher :on_bad_map_to_h, <<~PATTERN
39-
({send csend}
39+
(call
4040
(block
41-
({send csend} _ {:map :collect})
41+
(call _ {:map :collect})
4242
(args (arg $_el))
4343
(array $_ (lvar _el)))
4444
:to_h)
@@ -49,7 +49,7 @@ class IndexBy < Base
4949
(const _ :Hash)
5050
:[]
5151
(block
52-
({send csend} _ {:map :collect})
52+
(call _ {:map :collect})
5353
(args (arg $_el))
5454
(array $_ (lvar _el))))
5555
PATTERN

lib/rubocop/cop/rails/index_with.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ class IndexWith < Base
2626

2727
def_node_matcher :on_bad_each_with_object, <<~PATTERN
2828
(block
29-
({send csend} _ :each_with_object (hash))
29+
(call _ :each_with_object (hash))
3030
(args (arg $_el) (arg _memo))
31-
({send csend} (lvar _memo) :[]= (lvar _el) $!`_memo))
31+
(call (lvar _memo) :[]= (lvar _el) $!`_memo))
3232
PATTERN
3333

3434
def_node_matcher :on_bad_to_h, <<~PATTERN
3535
(block
36-
({send csend} _ :to_h)
36+
(call _ :to_h)
3737
(args (arg $_el))
3838
(array (lvar _el) $_))
3939
PATTERN
4040

4141
def_node_matcher :on_bad_map_to_h, <<~PATTERN
42-
({send csend}
42+
(call
4343
(block
44-
({send csend} _ {:map :collect})
44+
(call _ {:map :collect})
4545
(args (arg $_el))
4646
(array (lvar _el) $_))
4747
:to_h)
@@ -52,7 +52,7 @@ class IndexWith < Base
5252
(const _ :Hash)
5353
:[]
5454
(block
55-
({send csend} _ {:map :collect})
55+
(call _ {:map :collect})
5656
(args (arg $_el))
5757
(array (lvar _el) $_)))
5858
PATTERN

0 commit comments

Comments
 (0)