Skip to content

Instantly share code, notes, and snippets.

@dlbock
Created March 2, 2018 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlbock/4391150077b4e7c2ed66e7afedff39e4 to your computer and use it in GitHub Desktop.
Save dlbock/4391150077b4e7c2ed66e7afedff39e4 to your computer and use it in GitHub Desktop.
Upgrades rubocop, inherit generated .rubocop_todo.yml` file in `.rubocop.yml`
diff --git a/.gitignore b/.gitignore
index b280d1a..cd166f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
coverage/
Gemfile.lock
pkg/
+.bundle
+vendor/ruby
diff --git a/.rubocop.yml b/.rubocop.yml
index 19201ee..7b427b5 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,6 +1,12 @@
+inherit_from:
+ - .rubocop_todo.yml
+
AllCops:
- Exclude:
- - lib/prometheus/client/version.rb
+ DisplayCopNames: true
+ Exclude:
+ - lib/prometheus/client/version.rb
+ - .bundle/**/*
+ - vendor/**/*
AlignHash:
EnforcedHashRocketStyle: table
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
new file mode 100644
index 0000000..bdce305
--- /dev/null
+++ b/.rubocop_todo.yml
@@ -0,0 +1,95 @@
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2018-03-01 18:13:04 -0600 using RuboCop version 0.52.1.
+# 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
+# versions of RuboCop, may require this file to be generated again.
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Layout/EmptyLineAfterMagicComment:
+ Exclude:
+ - 'prometheus-client.gemspec'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
+Layout/IndentHeredoc:
+ Exclude:
+ - 'spec/prometheus/client/formats/text_spec.rb'
+
+# Offense count: 6
+Lint/AmbiguousBlockAssociation:
+ Exclude:
+ - 'spec/prometheus/client/counter_spec.rb'
+ - 'spec/prometheus/client/gauge_spec.rb'
+ - 'spec/prometheus/client/histogram_spec.rb'
+ - 'spec/prometheus/client/summary_spec.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+Lint/UnneededRequireStatement:
+ Exclude:
+ - 'lib/prometheus/client/metric.rb'
+ - 'lib/prometheus/client/registry.rb'
+ - 'spec/prometheus/client/registry_spec.rb'
+
+# Offense count: 3
+Lint/UriEscapeUnescape:
+ Exclude:
+ - 'lib/prometheus/client/push.rb'
+
+# Offense count: 18
+# Configuration parameters: CountComments, ExcludedMethods.
+Metrics/BlockLength:
+ Max: 113
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect.
+Performance/HashEachMethods:
+ Exclude:
+ - 'lib/prometheus/client/formats/text.rb'
+ - 'lib/prometheus/middleware/exporter.rb'
+
+# Offense count: 28
+# Cop supports --auto-correct.
+Style/Encoding:
+ Enabled: false
+
+# Offense count: 12
+# Configuration parameters: .
+# SupportedStyles: annotated, template, unannotated
+Style/FormatStringToken:
+ EnforcedStyle: unannotated
+
+# Offense count: 1
+# Configuration parameters: MinBodyLength.
+Style/GuardClause:
+ Exclude:
+ - 'lib/prometheus/client/metric.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: PreferredDelimiters.
+Style/PercentLiteralDelimiters:
+ Exclude:
+ - 'lib/prometheus/client/push.rb'
+ - 'prometheus-client.gemspec'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: implicit, explicit
+Style/RescueStandardError:
+ Exclude:
+ - 'lib/prometheus/middleware/collector.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: MinSize.
+# SupportedStyles: percent, brackets
+Style/SymbolArray:
+ EnforcedStyle: brackets
diff --git a/Gemfile b/Gemfile
index fdddf88..3f54b45 100644
--- a/Gemfile
+++ b/Gemfile
@@ -13,7 +13,7 @@ group :test do
gem 'rack-test'
gem 'rake'
gem 'rspec'
- gem 'rubocop', '< 0.42'
+ gem 'rubocop', '~> 0.52.1'
gem 'term-ansicolor', '< 1.4' if ruby_version?('< 2.0')
gem 'tins', '< 1.7' if ruby_version?('< 2.0')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment