Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -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: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
Expand Down Expand Up @@ -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'
2 changes: 1 addition & 1 deletion lib/dispatch-rider/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(options = {})
:dir => (@app_home + "log").to_s,
:multiple => false,
:monitor => false,
:identifier => 0,
:identifier => 0
}.merge(options)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/dispatch-rider/logging/translator/base_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
14 changes: 7 additions & 7 deletions spec/integration/logging_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -91,7 +91,7 @@ def error(message)
'phase' => 'start',
'guid' => 'test-mode-not-random-guid',
'subject' => 'crashing_handler',
'body' => {},
'body' => {}
}

expected2 = {
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -67,7 +67,7 @@
body: { some: 'key' },
reason: reason,
employee_id: 47,
account_id: 42,
account_id: 42
}.deep_stringify_keys.to_json
end

Expand All @@ -85,7 +85,7 @@
subject: 'test',
body: { some: 'key' },
employee_id: 47,
account_id: 42,
account_id: 42
}.deep_stringify_keys.to_json
end

Expand All @@ -96,7 +96,7 @@
subject: 'test',
body: { some: 'key' },
employee_id: 47,
account_id: 42,
account_id: 42
}.deep_stringify_keys.to_json
end

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/dispatch-rider/logging/text_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
phase: phase,
guid: '123',
body: { foo: :bar },
subject: 'sample_handler',
subject: 'sample_handler'
}
end

Expand Down
24 changes: 12 additions & 12 deletions spec/lib/dispatch-rider/logging/translator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
subject: 'sample_handler',
guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID,
body: {
'key' => 'value',
},
'key' => 'value'
}
}
end

Expand All @@ -47,8 +47,8 @@
subject: 'sample_handler',
guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID,
body: {
'key' => 'value',
},
'key' => 'value'
}
}
end

Expand All @@ -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
Expand All @@ -100,9 +100,9 @@
subject: 'sample_handler',
guid: DispatchRider::Debug::PUBLISHER_MESSAGE_GUID,
body: {
'key' => 'value',
'key' => 'value'
},
duration: 5,
duration: 5
}
end

Expand All @@ -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
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions spec/lib/dispatch-rider/publisher/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.publish(body, publisher)
message: {
subject: "Loud Cheering",
body: {
"bla" => "WOOOOOOOO!",
"bla" => "WOOOOOOOO!"
}
}
}
Expand All @@ -63,8 +63,8 @@ def self.publish(body, publisher)
message: {
subject: "Ferocious Tigers!",
body: {
"bla" => "RAAAAAWWWWW!",
},
"bla" => "RAAAAAWWWWW!"
}
}
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{
notification_services: {
file_system: {},
foo: { bar: "123" },
foo: { bar: "123" }
}
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
service: :file_system,
channel: :foo,
options: {
path: "tmp/test/channel",
path: "tmp/test/channel"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/dispatch-rider/publisher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down