From cfa14ec6d1719d8321ae63b4b646e364f1766b4e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 7 Nov 2023 04:11:04 -0500 Subject: [PATCH] Fix `Lint/EmptyBlock` cop (#27748) --- .rubocop_todo.yml | 10 ---------- spec/controllers/api/v2/search_controller_spec.rb | 2 +- spec/fabricators/access_token_fabricator.rb | 3 +-- spec/fabricators/conversation_fabricator.rb | 3 +-- spec/fabricators/system_key_fabricator.rb | 3 +-- spec/lib/activitypub/adapter_spec.rb | 2 +- spec/models/user_role_spec.rb | 2 +- 7 files changed, 6 insertions(+), 19 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e55fd698f..7cd42a8e6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -20,16 +20,6 @@ Layout/LineLength: Exclude: - 'app/models/account.rb' -# Configuration parameters: AllowComments, AllowEmptyLambdas. -Lint/EmptyBlock: - Exclude: - - 'spec/controllers/api/v2/search_controller_spec.rb' - - 'spec/fabricators/access_token_fabricator.rb' - - 'spec/fabricators/conversation_fabricator.rb' - - 'spec/fabricators/system_key_fabricator.rb' - - 'spec/lib/activitypub/adapter_spec.rb' - - 'spec/models/user_role_spec.rb' - Lint/NonLocalExitFromIterator: Exclude: - 'app/helpers/jsonld_helper.rb' diff --git a/spec/controllers/api/v2/search_controller_spec.rb b/spec/controllers/api/v2/search_controller_spec.rb index a3b92fc37..d3ff42d6a 100644 --- a/spec/controllers/api/v2/search_controller_spec.rb +++ b/spec/controllers/api/v2/search_controller_spec.rb @@ -53,7 +53,7 @@ RSpec.describe Api::V2::SearchController do context 'without token' do describe 'GET #index' do - let(:search_params) {} + let(:search_params) { nil } before do get :index, params: search_params diff --git a/spec/fabricators/access_token_fabricator.rb b/spec/fabricators/access_token_fabricator.rb index 508c32808..d07f1ca14 100644 --- a/spec/fabricators/access_token_fabricator.rb +++ b/spec/fabricators/access_token_fabricator.rb @@ -1,4 +1,3 @@ # frozen_string_literal: true -Fabricator :access_token, from: 'Doorkeeper::AccessToken' do -end +Fabricator :access_token, from: 'Doorkeeper::AccessToken' diff --git a/spec/fabricators/conversation_fabricator.rb b/spec/fabricators/conversation_fabricator.rb index 07c6780bf..5440e4380 100644 --- a/spec/fabricators/conversation_fabricator.rb +++ b/spec/fabricators/conversation_fabricator.rb @@ -1,4 +1,3 @@ # frozen_string_literal: true -Fabricator(:conversation) do -end +Fabricator(:conversation) diff --git a/spec/fabricators/system_key_fabricator.rb b/spec/fabricators/system_key_fabricator.rb index ef6cec9c4..bcb3bd557 100644 --- a/spec/fabricators/system_key_fabricator.rb +++ b/spec/fabricators/system_key_fabricator.rb @@ -1,4 +1,3 @@ # frozen_string_literal: true -Fabricator(:system_key) do -end +Fabricator(:system_key) diff --git a/spec/lib/activitypub/adapter_spec.rb b/spec/lib/activitypub/adapter_spec.rb index f9f8b8dce..7d8d703ec 100644 --- a/spec/lib/activitypub/adapter_spec.rb +++ b/spec/lib/activitypub/adapter_spec.rb @@ -53,7 +53,7 @@ RSpec.describe ActivityPub::Adapter do describe '#serializable_hash' do subject { ActiveModelSerializers::SerializableResource.new(TestObject.new(foo: 'bar'), serializer: serializer_class, adapter: described_class).as_json } - let(:serializer_class) {} + let(:serializer_class) { nil } context 'when serializer defines no context' do let(:serializer_class) { TestWithBasicContextSerializer } diff --git a/spec/models/user_role_spec.rb b/spec/models/user_role_spec.rb index f7cfe9bb0..d5234ebe8 100644 --- a/spec/models/user_role_spec.rb +++ b/spec/models/user_role_spec.rb @@ -60,7 +60,7 @@ RSpec.describe UserRole do end describe '#permissions_as_keys=' do - let(:input) {} + let(:input) { nil } before do subject.permissions_as_keys = input