From afc0d4fed0bf71b34163582f8cc7601d36a83c83 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Wed, 11 Aug 2021 04:02:11 +0900 Subject: [PATCH] Use `RESTRICT_ON_SEND` Follow up to https://github.com/rubocop/rubocop/pull/8365. This PR uses `RESTRICT_ON_SEND` to restrict callbacks `on_send` to specific method names only. --- lib/rubocop/cop/rake/helper/on_task.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rubocop/cop/rake/helper/on_task.rb b/lib/rubocop/cop/rake/helper/on_task.rb index 70c8df2..60d75f5 100644 --- a/lib/rubocop/cop/rake/helper/on_task.rb +++ b/lib/rubocop/cop/rake/helper/on_task.rb @@ -7,6 +7,8 @@ module Helper module OnTask extend NodePattern::Macros + RESTRICT_ON_SEND = %i[task].freeze + def_node_matcher :task?, <<~PATTERN (send nil? :task ...) PATTERN