From 6aa1204be73cb585165728d4fbfbc75d651b9104 Mon Sep 17 00:00:00 2001 From: dblock Date: Mon, 23 Nov 2015 14:56:40 -0500 Subject: [PATCH] Upgraded RuboCop to 0.35.1. --- .rubocop.yml | 1 - .rubocop_todo.yml | 39 ++++++++++++++++++++----------------- Gemfile | 2 +- gemfiles/rack_1.5.2.gemfile | 14 ++++++------- gemfiles/rails_3.gemfile | 16 +++++++-------- gemfiles/rails_4.gemfile | 14 ++++++------- spec/grape/api_spec.rb | 2 +- 7 files changed, 45 insertions(+), 43 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index ba51557cfb..bdd4025531 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,5 @@ AllCops: Exclude: - vendor/**/* - bin/**/* - - gemfiles/**/* inherit_from: .rubocop_todo.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 15779d89d4..a68d67cc3e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,16 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2015-08-19 13:28:59 -0400 using RuboCop version 0.33.0. +# on 2015-11-23 14:55:46 -0500 using RuboCop version 0.35.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 +Lint/DuplicatedKey: + Exclude: + - 'spec/grape/validations_spec.rb' + # Offense count: 1 Lint/NestedMethodDefinition: Exclude: @@ -22,18 +27,18 @@ Metrics/BlockNesting: # Offense count: 5 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 300 + Max: 277 -# Offense count: 23 +# Offense count: 22 Metrics/CyclomaticComplexity: - Max: 16 + Max: 14 -# Offense count: 717 +# Offense count: 751 # Configuration parameters: AllowURI, URISchemes. Metrics/LineLength: Max: 215 -# Offense count: 42 +# Offense count: 44 # Configuration parameters: CountComments. Metrics/MethodLength: Max: 36 @@ -43,17 +48,22 @@ Metrics/MethodLength: Metrics/ModuleLength: Max: 272 -# Offense count: 17 +# Offense count: 15 Metrics/PerceivedComplexity: - Max: 18 + Max: 16 -# Offense count: 30 +# Offense count: 44 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. Style/BlockDelimiters: - Enabled: false + Exclude: + - 'spec/grape/api_spec.rb' + - 'spec/grape/exceptions/validation_errors_spec.rb' + - 'spec/grape/middleware/versioner/header_spec.rb' + - 'spec/grape/request_spec.rb' -# Offense count: 167 +# Offense count: 105 +# Configuration parameters: Exclude. Style/Documentation: Enabled: false @@ -65,13 +75,6 @@ Style/DoubleNegation: - 'lib/grape/middleware/versioner/header.rb' - 'lib/grape/path.rb' -# Offense count: 3 -Style/EachWithObject: - Exclude: - - 'lib/grape/dsl/inside_route.rb' - - 'lib/grape/exceptions/base.rb' - - 'lib/grape/formatter/serializable_hash.rb' - # Offense count: 14 # Configuration parameters: EnforcedStyle, SupportedStyles. Style/RaiseArgs: diff --git a/Gemfile b/Gemfile index 9650127878..9651d99fb1 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rubocop', '0.33.0' + gem 'rubocop', '0.35.1' gem 'guard' gem 'guard-rspec' gem 'guard-rubocop' diff --git a/gemfiles/rack_1.5.2.gemfile b/gemfiles/rack_1.5.2.gemfile index a269f61505..787d3e5748 100644 --- a/gemfiles/rack_1.5.2.gemfile +++ b/gemfiles/rack_1.5.2.gemfile @@ -1,14 +1,14 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "rack", "1.5.2" +gem 'rack', '1.5.2' group :development, :test do - gem "rubocop", "0.33.0" - gem "guard" - gem "guard-rspec" - gem "guard-rubocop" + gem 'rubocop', '0.35.1' + gem 'guard' + gem 'guard-rspec' + gem 'guard-rubocop' end -gemspec :path => "../" +gemspec path: '../' diff --git a/gemfiles/rails_3.gemfile b/gemfiles/rails_3.gemfile index fb164a00ad..6e3ea393ed 100644 --- a/gemfiles/rails_3.gemfile +++ b/gemfiles/rails_3.gemfile @@ -1,15 +1,15 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "rails", "3.2.19" -gem "rack-cache", "<= 1.2" +gem 'rails', '3.2.19' +gem 'rack-cache', '<= 1.2' group :development, :test do - gem "rubocop", "0.33.0" - gem "guard" - gem "guard-rspec" - gem "guard-rubocop" + gem 'rubocop', '0.35.1' + gem 'guard' + gem 'guard-rspec' + gem 'guard-rubocop' end -gemspec :path => "../" +gemspec path: '../' diff --git a/gemfiles/rails_4.gemfile b/gemfiles/rails_4.gemfile index 12e4f2e37e..6abb9c32d7 100644 --- a/gemfiles/rails_4.gemfile +++ b/gemfiles/rails_4.gemfile @@ -1,14 +1,14 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "rails", "4.1.6" +gem 'rails', '4.1.6' group :development, :test do - gem "rubocop", "0.33.0" - gem "guard" - gem "guard-rspec" - gem "guard-rubocop" + gem 'rubocop', '0.35.1' + gem 'guard' + gem 'guard-rspec' + gem 'guard-rubocop' end -gemspec :path => "../" +gemspec path: '../' diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index 8b5b9d3513..a00652f759 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -809,7 +809,7 @@ def subject.enable_root_route! it 'returns raw data when content type binary' do image_filename = 'grape.png' - file = File.open(image_filename, 'rb') { |io| io.read } + file = File.open(image_filename, 'rb', &:read) subject.format :binary subject.get('/binary_file') { File.binread(image_filename) } get '/binary_file'