Skip to content

Commit ff7c61e

Browse files
committed
refactor: Use Block Argument Forwading
> This cop identifies places where do_something(&block) can be replaced by do_something(&) https://docs.rubocop.org/rubocop/cops_style.html#styleargumentsforwarding https://docs.rubocop.org/rubocop/cops_naming.html#namingblockforwarding
1 parent 1fc6949 commit ff7c61e

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

.rubocop.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ Metrics/PerceivedComplexity:
3838
Naming/FileName:
3939
Exclude:
4040
- '**/opentelemetry-*'
41-
### TODO: Enable this is a separate PR
42-
Naming/BlockForwarding:
43-
Enabled: false
44-
Style/ArgumentsForwarding:
45-
Enabled: false
46-
#######################
4741
Style/Documentation:
4842
Exclude:
4943
- "**/test/**/*"

instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ module Bunny
1212
# For additional details around trace messaging semantics
1313
# See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes
1414
module PatchHelpers
15-
def self.with_send_span(channel, tracer, exchange, routing_key, &block)
15+
def self.with_send_span(channel, tracer, exchange, routing_key, &)
1616
attributes = basic_attributes(channel, channel.connection, exchange, routing_key)
1717
destination = destination_name(exchange, routing_key)
1818

19-
tracer.in_span("#{destination} publish", attributes: attributes, kind: :producer, &block)
19+
tracer.in_span("#{destination} publish", attributes: attributes, kind: :producer, &)
2020
end
2121

2222
def self.with_process_span(channel, tracer, delivery_info, properties, &block)

0 commit comments

Comments
 (0)