From 347df06e306fe292fc998ddc0bc5cf97b50adbaa Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Tue, 19 Mar 2024 00:14:37 +0900 Subject: [PATCH] Suppress a RuboCop's offense This commit suppresses the following offense: ```console $ bundle exec rubocop -a (snip) Offenses: lib/rubocop/ast/traversal.rb:41:50: W: [Corrected] Lint/RedundantCopDisableDirective: Unnecessary disabling of Style/EvalWithLocation. module_eval(<<~RUBY, __FILE__, lineno) # rubocop:disable Style/EvalWithLocation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` --- lib/rubocop/ast/traversal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rubocop/ast/traversal.rb b/lib/rubocop/ast/traversal.rb index a50fbc18e..4fe015eee 100644 --- a/lib/rubocop/ast/traversal.rb +++ b/lib/rubocop/ast/traversal.rb @@ -38,7 +38,7 @@ def def_callback(type, *signature, body: self.body(signature, arity_check)) type, *aliases = type lineno = caller_locations(1, 1).first.lineno - module_eval(<<~RUBY, __FILE__, lineno) # rubocop:disable Style/EvalWithLocation + module_eval(<<~RUBY, __FILE__, lineno) def on_#{type}(node) # def on_send(node) #{body} # # body ... nil # nil