From 2959ec826f42d26592506e01db8fab06dbc4c0ce Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Mon, 12 Aug 2024 14:54:50 -0700 Subject: [PATCH] Fix instrumentation generator * Rubocop has stricter checks on using :: to prefix a class now It consistently fails on files generated from this template * There's a syntax error due to a missing comma in the config HEREDOC --- lib/tasks/instrumentation_generator/instrumentation.thor | 2 +- .../templates/dependency_detection.tt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/instrumentation_generator/instrumentation.thor b/lib/tasks/instrumentation_generator/instrumentation.thor index 06305c1074..567f6797b3 100644 --- a/lib/tasks/instrumentation_generator/instrumentation.thor +++ b/lib/tasks/instrumentation_generator/instrumentation.thor @@ -103,7 +103,7 @@ class Instrumentation < Thor <<-CONFIG :'instrumentation.#{snake_name}' => { :default => 'auto', - :documentation_default => 'auto' + :documentation_default => 'auto', :public => true, :type => String, :dynamic_name => true, diff --git a/lib/tasks/instrumentation_generator/templates/dependency_detection.tt b/lib/tasks/instrumentation_generator/templates/dependency_detection.tt index cb8a3783a5..2b17a16e80 100644 --- a/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +++ b/lib/tasks/instrumentation_generator/templates/dependency_detection.tt @@ -12,16 +12,16 @@ DependencyDetection.defer do depends_on do # The class that needs to be defined to prepend/chain onto. This can be used # to determine whether the library is installed. - defined?(::<%= @class_name %>) + defined?(<%= @class_name %>) # Add any additional requirements to verify whether this instrumentation # should be installed end executes do - ::NewRelic::Agent.logger.info('Installing <%= @name.downcase %> instrumentation') + NewRelic::Agent.logger.info('Installing <%= @name.downcase %> instrumentation') if use_prepend? - prepend_instrument ::<%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend + prepend_instrument <%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend else chain_instrument NewRelic::Agent::Instrumentation::<%= @class_name %>::Chain end