From 93b67a65d24ca94d294179c7d06959f7693b4217 Mon Sep 17 00:00:00 2001 From: FarhanAnjum-opti Date: Mon, 9 Dec 2024 19:19:06 +0600 Subject: [PATCH] linting fixes --- lib/optimizely/helpers/validator.rb | 4 ++-- lib/optimizely/optimizely_factory.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/optimizely/helpers/validator.rb b/lib/optimizely/helpers/validator.rb index d3baa447..4d975483 100644 --- a/lib/optimizely/helpers/validator.rb +++ b/lib/optimizely/helpers/validator.rb @@ -122,11 +122,11 @@ def inputs_valid?(variables, logger = NoOpLogger.new, level = Logger::ERROR) return false unless variables.respond_to?(:each) && !variables.empty? - is_valid = true + is_valid = true # rubocop:disable Lint/UselessAssignment if variables.include? :user_id # Empty str is a valid user ID. unless variables[:user_id].is_a?(String) - is_valid = false + is_valid = false # rubocop:disable Lint/UselessAssignment logger.log(level, "#{Constants::INPUT_VARIABLES['USER_ID']} is invalid") end variables.delete :user_id diff --git a/lib/optimizely/optimizely_factory.rb b/lib/optimizely/optimizely_factory.rb index 04c7ecdd..717e43d9 100644 --- a/lib/optimizely/optimizely_factory.rb +++ b/lib/optimizely/optimizely_factory.rb @@ -142,7 +142,6 @@ def self.custom_instance( # rubocop:disable Metrics/ParameterLists notification_center = nil, settings = nil ) - error_handler ||= NoOpErrorHandler.new logger ||= NoOpLogger.new notification_center = notification_center.is_a?(Optimizely::NotificationCenter) ? notification_center : NotificationCenter.new(logger, error_handler)