From 160fd14f57a12b841fc8cd15558a71555093b677 Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Mon, 11 Nov 2024 16:11:26 -0800 Subject: [PATCH] Update rubocop rules --- Rakefile | 8 ++++---- bin/jenkins/repackage-extension.rb | 4 ++-- lib/couchbase/logger.rb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index bda52d9e..efc248d9 100644 --- a/Rakefile +++ b/Rakefile @@ -27,7 +27,7 @@ end desc "Compile binary extension" task :compile do require 'tempfile' - Dir.chdir(Dir.tmpdir) do + Dir.chdir(Dir.tmpdir) do # rubocop:disable ThreadSafety/DirChdir sh "ruby '#{File.join(__dir__, 'ext', 'extconf.rb')}'" end end @@ -52,9 +52,9 @@ end desc "Encode git revision into 'ext/extconf.rb' template (dependency of 'build' task)" task :render_git_revision do - library_revision = Dir.chdir(__dir__) { `git rev-parse HEAD`.strip } - core_revision = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) { `git rev-parse HEAD`.strip } - core_describe = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) do + library_revision = Dir.chdir(__dir__) { `git rev-parse HEAD`.strip } # rubocop:disable ThreadSafety/DirChdir + core_revision = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) { `git rev-parse HEAD`.strip } # rubocop:disable ThreadSafety/DirChdir + core_describe = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) do # rubocop:disable ThreadSafety/DirChdir `git fetch --tags >/dev/null 2>&1` `git describe --long --always HEAD`.strip end diff --git a/bin/jenkins/repackage-extension.rb b/bin/jenkins/repackage-extension.rb index 30ed3b83..95ab5ac9 100755 --- a/bin/jenkins/repackage-extension.rb +++ b/bin/jenkins/repackage-extension.rb @@ -51,7 +51,7 @@ def bundle(target_dir) end if first_gemspec - Dir.chdir(first_gemspec.full_gem_path) do + Dir.chdir(first_gemspec.full_gem_path) do # rubocop:disable ThreadSafety/DirChdir File.write("lib/couchbase/libcouchbase.rb", <<-RUBY) begin require_relative "\#{RUBY_VERSION[/(\\d+\\.\\d+)/]}/libcouchbase" @@ -101,7 +101,7 @@ def repackage(gemspec) # build new gem output_gem = nil - Dir.chdir gemspec.full_gem_path do + Dir.chdir gemspec.full_gem_path do # rubocop:disable ThreadSafety/DirChdir output_gem = Gem::Package.build(gemspec, true) end diff --git a/lib/couchbase/logger.rb b/lib/couchbase/logger.rb index 9a3d6c16..a5b1ca05 100644 --- a/lib/couchbase/logger.rb +++ b/lib/couchbase/logger.rb @@ -46,7 +46,7 @@ def self.log_level # Return logger associated with the library def self.logger - @logger # rubocop:disable ThreadSafety/InstanceVariableInClassMethod + @logger # rubocop:disable ThreadSafety/ClassInstanceVariable end # Associate logger with the library @@ -67,8 +67,8 @@ def self.logger # # @since 3.4.0 def self.set_logger(logger, adapter_class: nil, verbose: false, level: :info) - @logger = logger # rubocop:disable ThreadSafety/InstanceVariableInClassMethod - if @logger.nil? # rubocop:disable ThreadSafety/InstanceVariableInClassMethod + @logger = logger # rubocop:disable ThreadSafety/ClassInstanceVariable + if @logger.nil? # rubocop:disable ThreadSafety/ClassInstanceVariable Backend.install_logger_shim(nil) return end