diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ee28fe1f..739d5576 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,18 +18,3 @@ jobs: bundler-cache: true - run: bin/bundle --jobs=$(nproc) --retry=$(nproc) - run: bin/rubocop -P - - reek: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1 - bundler: 2.4.12 - bundler-cache: true - - run: bin/bundle --jobs=$(nproc) --retry=$(nproc) - - run: bin/reek . diff --git a/lib/sidekiq_unique_jobs/lock_config.rb b/lib/sidekiq_unique_jobs/lock_config.rb index a0fdb613..49ab7555 100644 --- a/lib/sidekiq_unique_jobs/lock_config.rb +++ b/lib/sidekiq_unique_jobs/lock_config.rb @@ -113,19 +113,19 @@ def errors_as_string # the strategy to use as conflict resolution from sidekiq client def on_client_conflict - if on_conflict.is_a?(Hash) - @on_client_conflict ||= on_conflict["client"] || on_conflict[:client] + @on_client_conflict ||= if on_conflict.is_a?(Hash) + on_conflict["client"] || on_conflict[:client] else - @on_client_conflict ||= on_conflict + on_conflict end end # the strategy to use as conflict resolution from sidekiq server def on_server_conflict - if on_conflict.is_a?(Hash) - @on_server_conflict ||= on_conflict["server"] || on_conflict[:server] + @on_server_conflict ||= if on_conflict.is_a?(Hash) + on_conflict["server"] || on_conflict[:server] else - @on_server_conflict ||= on_conflict + on_conflict end end end diff --git a/spec/sidekiq_unique_jobs/lock_config_spec.rb b/spec/sidekiq_unique_jobs/lock_config_spec.rb index 97782ad6..50c0a012 100644 --- a/spec/sidekiq_unique_jobs/lock_config_spec.rb +++ b/spec/sidekiq_unique_jobs/lock_config_spec.rb @@ -148,7 +148,7 @@ end context "when on_conflict is defined only for server" do - let(:on_conflict) { {server: :log}} + let(:on_conflict) { { server: :log } } it { is_expected.to be_nil } end @@ -166,7 +166,7 @@ end context "when on_conflict is defined only for client" do - let(:on_conflict) { {client: :log}} + let(:on_conflict) { { client: :log } } it { is_expected.to be_nil } end