Unverified Commit 13f549b2 authored by Benjamin Neff's avatar Benjamin Neff
Browse files

Bump rubocop

And update config for new/updated cops.
parent 8330e5ef
...@@ -25,6 +25,15 @@ Metrics/ModuleLength: ...@@ -25,6 +25,15 @@ Metrics/ModuleLength:
Metrics/AbcSize: Metrics/AbcSize:
Max: 20 Max: 20
# Some blocks are longer.
Metrics/BlockLength:
ExcludedMethods:
- "namespace"
- "create_table"
Exclude:
- "config/**/*.rb"
- "spec/**/*.rb"
# No space makes the method definition shorter and differentiates # No space makes the method definition shorter and differentiates
# from a regular assignment. # from a regular assignment.
Style/SpaceAroundEqualsInParameterDefault: Style/SpaceAroundEqualsInParameterDefault:
...@@ -51,7 +60,7 @@ Style/HashSyntax: ...@@ -51,7 +60,7 @@ Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys EnforcedStyle: ruby19_no_mixed_keys
# has_key? and has_value? are far more readable than key? and value? # has_key? and has_value? are far more readable than key? and value?
Style/DeprecatedHashMethods: Style/PreferredHashMethods:
Enabled: false Enabled: false
# String#% is by far the least verbose and only object oriented variant. # String#% is by far the least verbose and only object oriented variant.
...@@ -147,7 +156,20 @@ Style/OpMethod: ...@@ -147,7 +156,20 @@ Style/OpMethod:
Lint/Debugger: Lint/Debugger:
Enabled: false Enabled: false
# We used comparison everywhere.
Style/NumericPredicate:
EnforcedStyle: comparison
# Reset some HoundCI changes back to Rubocop defaults # Reset some HoundCI changes back to Rubocop defaults
Style/DotPosition: Style/DotPosition:
EnforcedStyle: leading EnforcedStyle: leading
### backward compatibility
# only with ruby >= 2.3
Style/FrozenStringLiteralComment:
Enabled: false
# only with ruby >= 2.4
Performance/RegexpMatch:
Enabled: false
...@@ -244,7 +244,7 @@ group :development do ...@@ -244,7 +244,7 @@ group :development do
gem "rb-inotify", "0.9.8", require: false gem "rb-inotify", "0.9.8", require: false
# Linters # Linters
gem "rubocop", "0.40.0" gem "rubocop", "0.47.1"
gem "haml_lint", "0.18.2" gem "haml_lint", "0.18.2"
gem "pronto", "0.8.2" gem "pronto", "0.8.2"
gem "pronto-eslint", "0.8.0" gem "pronto-eslint", "0.8.0"
......
...@@ -628,8 +628,8 @@ GEM ...@@ -628,8 +628,8 @@ GEM
rspec-mocks (~> 3.5.0) rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0) rspec-support (~> 3.5.0)
rspec-support (3.5.0) rspec-support (3.5.0)
rubocop (0.40.0) rubocop (0.47.1)
parser (>= 2.3.1.0, < 3.0) parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1) powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
...@@ -898,7 +898,7 @@ DEPENDENCIES ...@@ -898,7 +898,7 @@ DEPENDENCIES
redcarpet (= 3.4.0) redcarpet (= 3.4.0)
responders (= 2.3.0) responders (= 2.3.0)
rspec-rails (= 3.5.2) rspec-rails (= 3.5.2)
rubocop (= 0.40.0) rubocop (= 0.47.1)
ruby-oembed (= 0.10.1) ruby-oembed (= 0.10.1)
rubyzip (= 1.2.1) rubyzip (= 1.2.1)
sass-rails (= 5.0.6) sass-rails (= 5.0.6)
......
...@@ -6,6 +6,7 @@ module NodeInfo ...@@ -6,6 +6,7 @@ module NodeInfo
SCHEMAS = {} SCHEMAS = {}
private_constant :VERSIONS, :SCHEMAS private_constant :VERSIONS, :SCHEMAS
# rubocop:disable Metrics/BlockLength
Document = Struct.new(:version, :software, :protocols, :services, :open_registrations, :usage, :metadata) do Document = Struct.new(:version, :software, :protocols, :services, :open_registrations, :usage, :metadata) do
Software = Struct.new(:name, :version) do Software = Struct.new(:name, :version) do
def initialize(name=nil, version=nil) def initialize(name=nil, version=nil)
...@@ -132,6 +133,7 @@ module NodeInfo ...@@ -132,6 +133,7 @@ module NodeInfo
end end
end end
end end
# rubocop:enable Metrics/BlockLength
def self.schema(version) def self.schema(version)
SCHEMAS[version] ||= JSON.parse( SCHEMAS[version] ||= JSON.parse(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment