Skip to content

Commit

Permalink
disable Metric rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasdanz committed Aug 6, 2024

Verified

This commit was signed with the committer’s verified signature.
raydouglass Ray Douglass
1 parent a3bbf09 commit 6a5c2f8
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -10,5 +10,8 @@ Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Metrics:
Enabled: false

Layout/LineLength:
Max: 120
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -59,6 +59,8 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-rspec (3.0.0)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
@@ -79,6 +81,7 @@ DEPENDENCIES
degica_datadog!
rspec (~> 3.0)
rubocop
rubocop-rspec
simplecov
simplecov-cobertura

2 changes: 1 addition & 1 deletion lib/degica_datadog/statsd.rb
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ class << self
# - <name>.95percentile
#
# The reported time is in milliseconds.
def with_timing(name, tags: {}) # rubocop:disable Metrics/MethodLength
def with_timing(name, tags: {})
if Config.enabled?
start = Time.now.to_f
begin
10 changes: 5 additions & 5 deletions lib/degica_datadog/tracing.rb
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@

module DegicaDatadog
# Tracing related functionality.
module Tracing # rubocop:disable Metrics/ModuleLength
class << self # rubocop:disable Metrics/ClassLength
module Tracing
class << self
# Initialize Datadog tracing. Call this in from config/application.rb.
def init(rake_tasks: []) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
def init(rake_tasks: [])
return unless Config.enabled?

require "datadog/auto_instrument"

Datadog.configure do |c| # rubocop:disable Metrics/BlockLength
Datadog.configure do |c|
c.service = Config.service
c.env = Config.environment
c.version = Config.version
@@ -126,7 +126,7 @@ def root_span_tags!(**tags)
# To pass in nested data to DD we need to pass keys separated with a "."
# eg, "outer.inner". This method takes a nested hash and flattens it by
# creating DD compatible key names.
def flatten_hash_for_span(hsh, key = nil) # rubocop:disable Metrics/MethodLength
def flatten_hash_for_span(hsh, key = nil)
flattened_hash = {}
hsh.each do |k, v|
flattened_key = [key, k].compact.join(".")
1 change: 0 additions & 1 deletion spec/config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

# rubocop:disable Metrics/BlockLength
RSpec.describe DegicaDatadog::Config do
describe ".init" do
context "full initialisation" do
2 changes: 0 additions & 2 deletions spec/statsd_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

# rubocop:disable Metrics/BlockLength
RSpec.describe DegicaDatadog::Statsd do
let(:stub_client) { double }

@@ -130,4 +129,3 @@
end
end
end
# rubocop:enable Metrics/BlockLength

0 comments on commit 6a5c2f8

Please sign in to comment.