Skip to content

Commit

Permalink
Merge pull request #78 from viralpraxis/simplify-node-patterns-replac…
Browse files Browse the repository at this point in the history
…e-send-csend-with-call

Simplify node patterns: replace union of `send` and `csend` with `call`
  • Loading branch information
viralpraxis authored Jan 23, 2025
2 parents 138de2b + b7a906b commit d84d48c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/thread_safety/dir_chdir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class DirChdir < Base
# @!method chdir?(node)
def_node_matcher :chdir?, <<~MATCHER
{
({send csend} (const {nil? cbase} {:Dir :FileUtils}) :chdir ...)
({send csend} (const {nil? cbase} :FileUtils) :cd ...)
(call (const {nil? cbase} {:Dir :FileUtils}) :chdir ...)
(call (const {nil? cbase} :FileUtils) :cd ...)
}
MATCHER

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/thread_safety/new_thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NewThread < Base

# @!method new_thread?(node)
def_node_matcher :new_thread?, <<~MATCHER
({send csend} (const {nil? cbase} :Thread) {:new :fork :start} ...)
(call (const {nil? cbase} :Thread) {:new :fork :start} ...)
MATCHER

def on_send(node)
Expand Down

0 comments on commit d84d48c

Please sign in to comment.