Bump rubocop
And update config for new/updated cops.
This commit is contained in:
parent
8330e5ef72
commit
13f549b2ba
4 changed files with 29 additions and 5 deletions
24
.rubocop.yml
24
.rubocop.yml
|
|
@ -25,6 +25,15 @@ Metrics/ModuleLength:
|
|||
Metrics/AbcSize:
|
||||
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
|
||||
# from a regular assignment.
|
||||
Style/SpaceAroundEqualsInParameterDefault:
|
||||
|
|
@ -51,7 +60,7 @@ Style/HashSyntax:
|
|||
EnforcedStyle: ruby19_no_mixed_keys
|
||||
|
||||
# has_key? and has_value? are far more readable than key? and value?
|
||||
Style/DeprecatedHashMethods:
|
||||
Style/PreferredHashMethods:
|
||||
Enabled: false
|
||||
|
||||
# String#% is by far the least verbose and only object oriented variant.
|
||||
|
|
@ -147,7 +156,20 @@ Style/OpMethod:
|
|||
Lint/Debugger:
|
||||
Enabled: false
|
||||
|
||||
# We used comparison everywhere.
|
||||
Style/NumericPredicate:
|
||||
EnforcedStyle: comparison
|
||||
|
||||
# Reset some HoundCI changes back to Rubocop defaults
|
||||
Style/DotPosition:
|
||||
EnforcedStyle: leading
|
||||
|
||||
### backward compatibility
|
||||
|
||||
# only with ruby >= 2.3
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
|
||||
# only with ruby >= 2.4
|
||||
Performance/RegexpMatch:
|
||||
Enabled: false
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -244,7 +244,7 @@ group :development do
|
|||
gem "rb-inotify", "0.9.8", require: false
|
||||
|
||||
# Linters
|
||||
gem "rubocop", "0.40.0"
|
||||
gem "rubocop", "0.47.1"
|
||||
gem "haml_lint", "0.18.2"
|
||||
gem "pronto", "0.8.2"
|
||||
gem "pronto-eslint", "0.8.0"
|
||||
|
|
|
|||
|
|
@ -628,8 +628,8 @@ GEM
|
|||
rspec-mocks (~> 3.5.0)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-support (3.5.0)
|
||||
rubocop (0.40.0)
|
||||
parser (>= 2.3.1.0, < 3.0)
|
||||
rubocop (0.47.1)
|
||||
parser (>= 2.3.3.1, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
rainbow (>= 1.99.1, < 3.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
|
|
@ -898,7 +898,7 @@ DEPENDENCIES
|
|||
redcarpet (= 3.4.0)
|
||||
responders (= 2.3.0)
|
||||
rspec-rails (= 3.5.2)
|
||||
rubocop (= 0.40.0)
|
||||
rubocop (= 0.47.1)
|
||||
ruby-oembed (= 0.10.1)
|
||||
rubyzip (= 1.2.1)
|
||||
sass-rails (= 5.0.6)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ module NodeInfo
|
|||
SCHEMAS = {}
|
||||
private_constant :VERSIONS, :SCHEMAS
|
||||
|
||||
# rubocop:disable Metrics/BlockLength
|
||||
Document = Struct.new(:version, :software, :protocols, :services, :open_registrations, :usage, :metadata) do
|
||||
Software = Struct.new(:name, :version) do
|
||||
def initialize(name=nil, version=nil)
|
||||
|
|
@ -132,6 +133,7 @@ module NodeInfo
|
|||
end
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics/BlockLength
|
||||
|
||||
def self.schema(version)
|
||||
SCHEMAS[version] ||= JSON.parse(
|
||||
|
|
|
|||
Loading…
Reference in a new issue