Fix UseRestrictOnSend false positives on child-node method name checks

What does this MR do and why?

The cop previously flagged any method_name(x) == :foo check inside on_send, even when x was a child node rather than the on_send parameter itself. RESTRICT_ON_SEND cannot express constraints on child nodes, so these were false positives requiring inline disable comments.

Thread the on_send parameter name through the four node matchers so method_name_plain only matches when the subject is the on_send parameter.

Fixes: #90 (closed)

Edited by Peter Leitzen

Merge request reports

Loading