From 97d8da23aa41e41832c95b4015901d7210ca50c5 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Tue, 30 May 2023 23:33:32 +0000 Subject: [PATCH 1/3] :police_car: regenerate rubocop todo --- .rubocop_todo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2d540c9..db0b123 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 180` -# on 2023-04-20 23:33:11 UTC using RuboCop version 1.50.2. +# on 2023-05-30 23:33:32 UTC using RuboCop version 1.51.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new From ab01055dace5113322d8cf6df0b0b63bb8bcdbf1 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Tue, 30 May 2023 23:33:39 +0000 Subject: [PATCH 2/3] :police_car: Style/TrailingCommaInHashLiteral --- .rubocop_todo.yml | 19 --------------- lib/dispatch-rider/command.rb | 2 +- .../logging/translator/base_translator.rb | 4 ++-- spec/factories/messages.rb | 2 +- spec/integration/logging_spec.rb | 14 +++++------ .../logging/lifecycle_logger_spec.rb | 8 +++---- .../logging/text_formatter_spec.rb | 2 +- .../dispatch-rider/logging/translator_spec.rb | 24 +++++++++---------- .../lib/dispatch-rider/publisher/base_spec.rb | 6 ++--- .../publisher/configuration_reader_spec.rb | 2 +- .../publisher/configuration_support_spec.rb | 2 +- spec/lib/dispatch-rider/publisher_spec.rb | 4 ++-- .../queue_services/aws_sqs_spec.rb | 4 ++-- 13 files changed, 37 insertions(+), 56 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index db0b123..6cbaa1d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -507,22 +507,3 @@ Style/StringConcatenation: - 'lib/dispatch-rider/logging/text_formatter.rb' - 'lib/generators/dispatch_rider/job/dispatch_job_generator.rb' - 'spec/spec_helper.rb' - -# Offense count: 37 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInHashLiteral: - Exclude: - - 'lib/dispatch-rider/command.rb' - - 'lib/dispatch-rider/logging/translator/base_translator.rb' - - 'spec/factories/messages.rb' - - 'spec/integration/logging_spec.rb' - - 'spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb' - - 'spec/lib/dispatch-rider/logging/text_formatter_spec.rb' - - 'spec/lib/dispatch-rider/logging/translator_spec.rb' - - 'spec/lib/dispatch-rider/publisher/base_spec.rb' - - 'spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb' - - 'spec/lib/dispatch-rider/publisher/configuration_support_spec.rb' - - 'spec/lib/dispatch-rider/publisher_spec.rb' - - 'spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb' diff --git a/lib/dispatch-rider/command.rb b/lib/dispatch-rider/command.rb index 4c400c5..ab7a397 100644 --- a/lib/dispatch-rider/command.rb +++ b/lib/dispatch-rider/command.rb @@ -15,7 +15,7 @@ def initialize(options = {}) :dir => (@app_home + "log").to_s, :multiple => false, :monitor => false, - :identifier => 0, + :identifier => 0 }.merge(options) end diff --git a/lib/dispatch-rider/logging/translator/base_translator.rb b/lib/dispatch-rider/logging/translator/base_translator.rb index 5a4a43f..8fe13ac 100644 --- a/lib/dispatch-rider/logging/translator/base_translator.rb +++ b/lib/dispatch-rider/logging/translator/base_translator.rb @@ -18,7 +18,7 @@ def message_info_fragment(message) { guid: message.guid.to_s, subject: message.subject, - body: message_info_arguments(message), + body: message_info_arguments(message) } end @@ -33,7 +33,7 @@ def exception_info_fragment(message, exception) exception_details = { exception: { class: exception.class.to_s, - message: exception.message, + message: exception.message } } message_info_fragment(message).merge exception_details diff --git a/spec/factories/messages.rb b/spec/factories/messages.rb index ca7be41..bc1e92c 100644 --- a/spec/factories/messages.rb +++ b/spec/factories/messages.rb @@ -6,7 +6,7 @@ body { { 'key' => 'value', - 'guid' => DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, + 'guid' => DispatchRider::Debug::PUBLISHER_MESSAGE_GUID } } initialize_with { DispatchRider::Message.new(attributes) } diff --git a/spec/integration/logging_spec.rb b/spec/integration/logging_spec.rb index 37854b9..c28141f 100644 --- a/spec/integration/logging_spec.rb +++ b/spec/integration/logging_spec.rb @@ -48,21 +48,21 @@ def error(message) 'phase' => 'start', 'guid' => 'test-mode-not-random-guid', 'subject' => 'sample_handler', - 'body' => {}, + 'body' => {} } expected2 = { 'phase' => 'success', 'guid' => 'test-mode-not-random-guid', 'subject' => 'sample_handler', - 'body' => {}, + 'body' => {} } expected3 = { 'phase' => 'complete', 'guid' => 'test-mode-not-random-guid', 'subject' => 'sample_handler', - 'body' => {}, + 'body' => {} } expect(mock_logger.log.count).to eq(3) @@ -91,7 +91,7 @@ def error(message) 'phase' => 'start', 'guid' => 'test-mode-not-random-guid', 'subject' => 'crashing_handler', - 'body' => {}, + 'body' => {} } expected2 = { @@ -101,15 +101,15 @@ def error(message) 'body' => {}, 'exception' => { 'class' => 'RuntimeError', - 'message' => 'I crashed!', - }, + 'message' => 'I crashed!' + } } expected3 = { 'phase' => 'complete', 'guid' => 'test-mode-not-random-guid', 'subject' => 'crashing_handler', - 'body' => {}, + 'body' => {} } expect(mock_logger.log.count).to eq(3) diff --git a/spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb b/spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb index 01c2f7b..2c646b6 100644 --- a/spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb +++ b/spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb @@ -48,7 +48,7 @@ body: { some: 'key' }, exception: { class: 'StandardError', message: 'something failed' }, employee_id: 47, - account_id: 42, + account_id: 42 }.deep_stringify_keys.to_json end @@ -67,7 +67,7 @@ body: { some: 'key' }, reason: reason, employee_id: 47, - account_id: 42, + account_id: 42 }.deep_stringify_keys.to_json end @@ -85,7 +85,7 @@ subject: 'test', body: { some: 'key' }, employee_id: 47, - account_id: 42, + account_id: 42 }.deep_stringify_keys.to_json end @@ -96,7 +96,7 @@ subject: 'test', body: { some: 'key' }, employee_id: 47, - account_id: 42, + account_id: 42 }.deep_stringify_keys.to_json end diff --git a/spec/lib/dispatch-rider/logging/text_formatter_spec.rb b/spec/lib/dispatch-rider/logging/text_formatter_spec.rb index ac3ab38..e5be570 100644 --- a/spec/lib/dispatch-rider/logging/text_formatter_spec.rb +++ b/spec/lib/dispatch-rider/logging/text_formatter_spec.rb @@ -11,7 +11,7 @@ phase: phase, guid: '123', body: { foo: :bar }, - subject: 'sample_handler', + subject: 'sample_handler' } end diff --git a/spec/lib/dispatch-rider/logging/translator_spec.rb b/spec/lib/dispatch-rider/logging/translator_spec.rb index c557d7d..00bd2b6 100644 --- a/spec/lib/dispatch-rider/logging/translator_spec.rb +++ b/spec/lib/dispatch-rider/logging/translator_spec.rb @@ -25,8 +25,8 @@ subject: 'sample_handler', guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, body: { - 'key' => 'value', - }, + 'key' => 'value' + } } end @@ -47,8 +47,8 @@ subject: 'sample_handler', guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, body: { - 'key' => 'value', - }, + 'key' => 'value' + } } end @@ -73,11 +73,11 @@ subject: 'sample_handler', guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, body: { - 'key' => 'value', + 'key' => 'value' }, exception: { class: 'ArgumentError', - message: 'Foo is not bar', + message: 'Foo is not bar' } } end @@ -100,9 +100,9 @@ subject: 'sample_handler', guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, body: { - 'key' => 'value', + 'key' => 'value' }, - duration: 5, + duration: 5 } end @@ -127,11 +127,11 @@ subject: 'sample_handler', guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, body: { - 'key' => 'value', + 'key' => 'value' }, exception: { class: 'ArgumentError', - message: 'Foo is not bar', + message: 'Foo is not bar' } } end @@ -154,9 +154,9 @@ subject: 'sample_handler', guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, body: { - 'key' => 'value', + 'key' => 'value' }, - reason: 'Got TERM', + reason: 'Got TERM' } end diff --git a/spec/lib/dispatch-rider/publisher/base_spec.rb b/spec/lib/dispatch-rider/publisher/base_spec.rb index 56e458d..d5ae107 100644 --- a/spec/lib/dispatch-rider/publisher/base_spec.rb +++ b/spec/lib/dispatch-rider/publisher/base_spec.rb @@ -44,7 +44,7 @@ def self.publish(body, publisher) message: { subject: "Loud Cheering", body: { - "bla" => "WOOOOOOOO!", + "bla" => "WOOOOOOOO!" } } } @@ -63,8 +63,8 @@ def self.publish(body, publisher) message: { subject: "Ferocious Tigers!", body: { - "bla" => "RAAAAAWWWWW!", - }, + "bla" => "RAAAAAWWWWW!" + } } } end diff --git a/spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb b/spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb index bc72b1d..15cc7c8 100644 --- a/spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb +++ b/spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb @@ -70,7 +70,7 @@ { notification_services: { file_system: {}, - foo: { bar: "123" }, + foo: { bar: "123" } } } end diff --git a/spec/lib/dispatch-rider/publisher/configuration_support_spec.rb b/spec/lib/dispatch-rider/publisher/configuration_support_spec.rb index 0b23883..7d9b2a2 100644 --- a/spec/lib/dispatch-rider/publisher/configuration_support_spec.rb +++ b/spec/lib/dispatch-rider/publisher/configuration_support_spec.rb @@ -29,7 +29,7 @@ service: :file_system, channel: :foo, options: { - path: "tmp/test/channel", + path: "tmp/test/channel" } } } diff --git a/spec/lib/dispatch-rider/publisher_spec.rb b/spec/lib/dispatch-rider/publisher_spec.rb index cbaf968..00b20f7 100644 --- a/spec/lib/dispatch-rider/publisher_spec.rb +++ b/spec/lib/dispatch-rider/publisher_spec.rb @@ -129,8 +129,8 @@ "subject" => "bar_handler", "body" => { "guid" => DispatchRider::Debug::PUBLISHER_MESSAGE_GUID, - "bar" => "baz", - }, + "bar" => "baz" + } } expect(data).to eq(expected_message) end diff --git a/spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb b/spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb index 297000e..8542111 100644 --- a/spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb +++ b/spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb @@ -62,7 +62,7 @@ "SenderId" => "123456789012", "SentTimestamp" => Time.now.to_i.to_s, "ApproximateReceivedCount" => "12", - "ApproximateFirstReceiveTimestamp" => (Time.now + 12).to_i.to_s, + "ApproximateFirstReceiveTimestamp" => (Time.now + 12).to_i.to_s } end @@ -124,7 +124,7 @@ "SenderId" => "123456789012", "SentTimestamp" => Time.now.to_i.to_s, "ApproximateReceivedCount" => "12", - "ApproximateFirstReceiveTimestamp" => (Time.now + 12).to_i.to_s, + "ApproximateFirstReceiveTimestamp" => (Time.now + 12).to_i.to_s } end From 6d7c2408a4526702c2231caf79cf733a50569aca Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Tue, 30 May 2023 23:33:46 +0000 Subject: [PATCH 3/3] :police_car: regenerate rubocop todo --- .rubocop_todo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6cbaa1d..f327eef 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 180` -# on 2023-05-30 23:33:32 UTC using RuboCop version 1.51.0. +# on 2023-05-30 23:33:45 UTC using RuboCop version 1.51.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new