Upgraded RuboCop to 0.53.0.

This commit is contained in:
dblock 2018-03-14 14:58:08 -04:00
parent 1995ba4676
commit 7670d9aed7
7 changed files with 43 additions and 26 deletions

View file

@ -1,33 +1,47 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `rubocop --auto-gen-config`
# on 2017-10-09 10:22:52 -0500 using RuboCop version 0.41.2. # on 2018-03-14 14:57:44 -0400 using RuboCop version 0.53.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/DuplicatedGem:
Exclude:
- 'Gemfile'
# Offense count: 1 # Offense count: 1
Metrics/AbcSize: Metrics/AbcSize:
Max: 18 Max: 17
# Offense count: 23
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 133
# Offense count: 1 # Offense count: 1
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:
Max: 9 Max: 9
# Offense count: 1
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 87
# Offense count: 1 # Offense count: 1
# Configuration parameters: CountComments. # Configuration parameters: CountComments.
Metrics/MethodLength: Metrics/MethodLength:
Max: 18 Max: 15
# Offense count: 1 # Offense count: 1
Metrics/PerceivedComplexity: Metrics/PerceivedComplexity:
Max: 11 Max: 10
# Offense count: 2
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
Exclude:
- 'lib/grape-active_model_serializers.rb'
- 'spec/grape-active_model_serializers_spec.rb'
# Offense count: 5 # Offense count: 5
Style/Documentation: Style/Documentation:
@ -40,9 +54,14 @@ Style/Documentation:
- 'lib/grape-active_model_serializers/options_builder.rb' - 'lib/grape-active_model_serializers/options_builder.rb'
- 'lib/grape-active_model_serializers/serializer_resolver.rb' - 'lib/grape-active_model_serializers/serializer_resolver.rb'
# Offense count: 2 # Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts. # Configuration parameters: MinBodyLength.
Style/FileName: Style/GuardClause:
Exclude: Exclude:
- 'lib/grape-active_model_serializers.rb' - 'lib/grape-active_model_serializers/serializer_resolver.rb'
- 'spec/grape-active_model_serializers_spec.rb'
# Offense count: 2
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 87

View file

@ -10,7 +10,7 @@ else
end end
group :test do group :test do
gem 'sqlite3'
gem 'sequel', '~> 4.37', require: false
gem 'ruby-grape-danger', '~> 0.1.0', require: false gem 'ruby-grape-danger', '~> 0.1.0', require: false
gem 'sequel', '~> 4.37', require: false
gem 'sqlite3'
end end

2
Rakefile Normal file → Executable file
View file

@ -11,4 +11,4 @@ end
require 'rubocop/rake_task' require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop) RuboCop::RakeTask.new(:rubocop)
task default: [:rubocop, :spec] task default: %i[rubocop spec]

View file

@ -24,5 +24,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rack-test' gem.add_development_dependency 'rack-test'
gem.add_development_dependency 'rake' gem.add_development_dependency 'rake'
gem.add_development_dependency 'guard-rspec' gem.add_development_dependency 'guard-rspec'
gem.add_development_dependency 'rubocop', '0.41.2' gem.add_development_dependency 'rubocop', '0.53.0'
end end

View file

@ -50,11 +50,9 @@ module Grape
resources resources
end end
def default_serializer_options def default_serializer_options; end
end
def url_options def url_options; end
end
end end
Endpoint.send(:include, EndpointExtension) Endpoint.send(:include, EndpointExtension)

View file

@ -7,7 +7,7 @@ module Grape
end end
def options def options
@options ||= ( @options ||= begin
options = endpoint_options options = endpoint_options
options[:scope] = endpoint unless options.key?(:scope) options[:scope] = endpoint unless options.key?(:scope)
options.merge!(default_root_options) unless options.key?(:root) options.merge!(default_root_options) unless options.key?(:root)
@ -15,7 +15,7 @@ module Grape
options.merge!(adapter_options) options.merge!(adapter_options)
options.merge!(extra_options) options.merge!(extra_options)
options options
) end
end end
private private

View file

@ -4,7 +4,7 @@ require 'grape-active_model_serializers/error_formatter'
describe Grape::ErrorFormatter::ActiveModelSerializers do describe Grape::ErrorFormatter::ActiveModelSerializers do
subject { Grape::ErrorFormatter::ActiveModelSerializers } subject { Grape::ErrorFormatter::ActiveModelSerializers }
let(:backtrace) { ['Line:1'] } let(:backtrace) { ['Line:1'] }
let(:options) { Hash.new } let(:options) { {} }
let(:env) { { 'api.endpoint' => app.endpoints.first } } let(:env) { { 'api.endpoint' => app.endpoints.first } }
let(:original_exception) { StandardError.new('oh noes!') } let(:original_exception) { StandardError.new('oh noes!') }