DEV: use discourse rubocop correctly

DEV: use discourse rubocop correctly

We upgraded to version 2 which is far easier to configure

Also lint files

follows up on #b0984a9b

diff --git a/.rubocop.yml b/.rubocop.yml
new file mode 100644
index 0000000..d46296c
--- /dev/null
+++ b/.rubocop.yml
@@ -0,0 +1,2 @@
+inherit_gem:
+  rubocop-discourse: default.yml
diff --git a/lib/prometheus_exporter/instrumentation/sidekiq_queue.rb b/lib/prometheus_exporter/instrumentation/sidekiq_queue.rb
index ab4544d..e666e2c 100644
--- a/lib/prometheus_exporter/instrumentation/sidekiq_queue.rb
+++ b/lib/prometheus_exporter/instrumentation/sidekiq_queue.rb
@@ -29,7 +29,7 @@ module PrometheusExporter::Instrumentation
     def collect_queue_stats
       ::Sidekiq::Queue.all.map do |queue|
         {
-          backlog_total:   queue.size,
+          backlog_total: queue.size,
           latency_seconds: queue.latency.to_i,
           labels: { queue: queue.name }
         }
diff --git a/lib/prometheus_exporter/server/sidekiq_queue_collector.rb b/lib/prometheus_exporter/server/sidekiq_queue_collector.rb
index 842541f..c2be01f 100644
--- a/lib/prometheus_exporter/server/sidekiq_queue_collector.rb
+++ b/lib/prometheus_exporter/server/sidekiq_queue_collector.rb
@@ -1,9 +1,10 @@
+# frozen_string_literal: true
 module PrometheusExporter::Server
   class SidekiqQueueCollector < TypeCollector
     MAX_SIDEKIQ_METRIC_AGE = 60
 
     SIDEKIQ_QUEUE_GAUGES = {
-      'backlog_total'   => 'Size of the sidekiq queue.',
+      'backlog_total' => 'Size of the sidekiq queue.',
       'latency_seconds' => 'Latency of the sidekiq queue.',
     }.freeze
 
diff --git a/prometheus_exporter.gemspec b/prometheus_exporter.gemspec
index 2724e2c..e1aaf8d 100644
--- a/prometheus_exporter.gemspec
+++ b/prometheus_exporter.gemspec
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency "oj", "~> 3.0"
   spec.add_development_dependency "rack-test", "~> 0.8.3"
   spec.add_development_dependency "minitest-stub-const", "~> 0.6"
-  spec.add_development_dependency 'rubocop-discourse', '~> 1.0'
+  spec.add_development_dependency "rubocop-discourse", ">2"
   if !RUBY_ENGINE == 'jruby'
     spec.add_development_dependency "raindrops", "~> 0.19"
   end

GitHub sha: 14d3fbf3

1 Like