From f97ac7c51b9038e7f26021290cce4d28538a2263 Mon Sep 17 00:00:00 2001 From: mhenrixon Date: Sat, 11 Nov 2023 15:45:12 +0200 Subject: [PATCH 1/2] fix: ignore reek for now --- .github/workflows/lint.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ee28fe1f8..739d5576b 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 . From 61352c45cd1b339b181b456f1faa8e3a3d88c957 Mon Sep 17 00:00:00 2001 From: mhenrixon Date: Sat, 11 Nov 2023 15:48:37 +0200 Subject: [PATCH 2/2] chore(lint): lint'em real good --- lib/sidekiq_unique_jobs/lock_config.rb | 12 ++++++------ spec/sidekiq_unique_jobs/lock_config_spec.rb | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/sidekiq_unique_jobs/lock_config.rb b/lib/sidekiq_unique_jobs/lock_config.rb index a0fdb613f..49ab7555c 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 97782ad68..50c0a012d 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