Skip to content

Commit

Permalink
Upgraded RuboCop to 0.28.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Dec 15, 2014
1 parent f613e67 commit b22da9c
Show file tree
Hide file tree
Showing 108 changed files with 953 additions and 1,043 deletions.
66 changes: 0 additions & 66 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,4 @@ AllCops:
- bin/**/*
- gemfiles/**/*

LineLength:
Enabled: false

MethodLength:
Enabled: false

ClassLength:
Enabled: false

Documentation:
# don't require classes to be documented
Enabled: false

CollectionMethods:
# don't prefer map to collect, recuce to inject
Enabled: false

Encoding:
# no need to always specify encoding
Enabled: false

StringLiterals:
# use single or double-quoted strings, as you please
Enabled: false

Void:
# == operator used in void context in specs
Enabled: false

SignalException:
# prefer raise to fail
EnforcedStyle: only_raise

RaiseArgs:
# don't care for what kind of raise
Enabled: false

PerlBackrefs:
# TODO: regular expression matching with $1, $2, etc.
Enabled: false

BlockNesting:
# TODO: fix too much nesting
Max: 4

Lambda:
# TODO: replace all lambda with -> or Proc
Enabled: false

Blocks:
# allow multi-line blocks like expect { }
Enabled: false

WordArray:
# %w vs. [ '', ... ]
Enabled: false

CyclomaticComplexity:
Enabled: false

DoubleNegation:
Enabled: false

PredicateName:
Enabled: false

inherit_from: .rubocop_todo.yml
95 changes: 78 additions & 17 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,125 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2014-08-12 13:16:39 +0200 using RuboCop version 0.24.1.
# on 2014-12-14 14:50:02 -0500 using RuboCop version 0.28.0.
# 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: 28
# Offense count: 29
# Cop supports --auto-correct.
Lint/UnusedBlockArgument:
Enabled: false

# Offense count: 30
# Offense count: 25
# Cop supports --auto-correct.
Lint/UnusedMethodArgument:
Enabled: false

# Offense count: 5
# Offense count: 35
Metrics/AbcSize:
Max: 51

# Offense count: 1
Metrics/BlockNesting:
Max: 4

# Offense count: 4
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 243

# Offense count: 15
Metrics/CyclomaticComplexity:
Max: 21

# Offense count: 546
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 198

# Offense count: 42
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 35

# Offense count: 13
Metrics/PerceivedComplexity:
Max: 21

# Offense count: 26
# Cop supports --auto-correct.
Style/Blocks:
Enabled: false

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassCheck:
Enabled: false

# Offense count: 6
# Offense count: 157
Style/Documentation:
Enabled: false

# Offense count: 7
Style/DoubleNegation:
Enabled: false

# Offense count: 5
Style/EachWithObject:
Enabled: false

# Offense count: 11
# Offense count: 1
Style/EmptyElse:
Enabled: false

# Offense count: 14
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Enabled: false

# Offense count: 1
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/HashSyntax:
Enabled: false

# Offense count: 14
# Offense count: 15
# Cop supports --auto-correct.
Style/IndentArray:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/IndentHash:
Enabled: true
# Offense count: 18
Style/Lambda:
Enabled: false

# Offense count: 3
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Offense count: 1
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
Style/Next:
Enabled: false

# Offense count: 2
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Enabled: false

# Offense count: 1
# Offense count: 3
# Configuration parameters: NamePrefix, NamePrefixBlacklist.
Style/PredicateName:
Enabled: false

# Offense count: 9
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/RaiseArgs:
Enabled: false

# Offense count: 4
# Configuration parameters: MaxSlashes.
Style/RegexpLiteral:
Enabled: false

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/SpaceBeforeBlockBraces:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'http://rubygems.org'
gemspec

group :development, :test do
gem 'rubocop', '~> 0.24.1'
gem 'rubocop', '~> 0.28.0'
gem 'guard'
gem 'guard-rspec'
gem 'guard-rubocop'
Expand Down
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
guard :rspec, all_on_start: true, cmd: 'bundle exec rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
watch('spec/spec_helper.rb') { 'spec' }
end

guard :rubocop do
Expand Down
21 changes: 10 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,32 @@ begin
end

namespace :pages do

desc "Check out gh-pages."
desc 'Check out gh-pages.'
task :checkout do
dir = File.dirname(__FILE__) + '/../grape.doc'
unless Dir.exist?(dir)
Dir.mkdir(dir)
Dir.chdir(dir) do
system("git init")
system("git remote add origin [email protected]:intridea/grape.git")
system("git pull")
system("git checkout gh-pages")
system('git init')
system('git remote add origin [email protected]:intridea/grape.git')
system('git pull')
system('git checkout gh-pages')
end
end
end

desc 'Generate and publish YARD docs to GitHub pages.'
task :publish => ['doc:pages:checkout', 'doc:pages'] do
Dir.chdir(File.dirname(__FILE__) + '/../grape.doc') do
system("git checkout gh-pages")
system("git add .")
system("git add -u")
system('git checkout gh-pages')
system('git add .')
system('git add -u')
system("git commit -m 'Generating docs for version #{Grape::VERSION}.'")
system("git push origin gh-pages")
system('git push origin gh-pages')
end
end
end
end
rescue LoadError
puts "You need to install YARD."
puts 'You need to install YARD.'
end
14 changes: 7 additions & 7 deletions gemfiles/rails_3.gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This file was generated by Appraisal

source "http://rubygems.org"
source 'http://rubygems.org'

gem "rails", "3.2.19"
gem 'rails', '3.2.19'

group :development, :test do
gem "rubocop", "~> 0.24.1"
gem "guard"
gem "guard-rspec"
gem "guard-rubocop"
gem 'rubocop', '~> 0.28.0'
gem 'guard'
gem 'guard-rspec'
gem 'guard-rubocop'
end

gemspec :path => "../"
gemspec :path => '../'
14 changes: 7 additions & 7 deletions gemfiles/rails_4.gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This file was generated by Appraisal

source "http://rubygems.org"
source 'http://rubygems.org'

gem "rails", "4.1.6"
gem 'rails', '4.1.6'

group :development, :test do
gem "rubocop", "~> 0.24.1"
gem "guard"
gem "guard-rspec"
gem "guard-rubocop"
gem 'rubocop', '~> 0.28.0'
gem 'guard'
gem 'guard-rspec'
gem 'guard-rubocop'
end

gemspec :path => "../"
gemspec :path => '../'
18 changes: 9 additions & 9 deletions grape.gemspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
$:.push File.expand_path("../lib", __FILE__)
require "grape/version"
$:.push File.expand_path('../lib', __FILE__)
require 'grape/version'

Gem::Specification.new do |s|
s.name = "grape"
s.name = 'grape'
s.version = Grape::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Michael Bleigh"]
s.email = ["[email protected]"]
s.homepage = "https://github.com/intridea/grape"
s.authors = ['Michael Bleigh']
s.email = ['[email protected]']
s.homepage = 'https://github.com/intridea/grape'
s.summary = %q{A simple Ruby framework for building REST-like APIs.}
s.description = %q{A Ruby framework for rapid API development with great conventions.}
s.license = "MIT"
s.license = 'MIT'

s.rubyforge_project = "grape"
s.rubyforge_project = 'grape'

s.add_runtime_dependency 'rack', '>= 1.3.0'
s.add_runtime_dependency 'rack-mount'
Expand All @@ -39,5 +39,5 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.require_paths = ['lib']
end
2 changes: 1 addition & 1 deletion lib/backports/active_support/deep_dup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Array
# array[1][2] #=> nil
# dup[1][2] #=> 4
def deep_dup
map { |it| it.deep_dup }
map(&:deep_dup)
end
end

Expand Down
6 changes: 2 additions & 4 deletions lib/grape/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def prepare_routes
# block passed in. Allows for simple 'before' setups
# of settings stack pushes.
def nest(*blocks, &block)
blocks.reject! { |b| b.nil? }
blocks.reject!(&:nil?)
if blocks.any?
instance_eval(&block) if block_given?
blocks.each { |b| instance_eval(&b) }
Expand All @@ -82,9 +82,7 @@ def inherited(subclass)
def inherit_settings(other_settings)
top_level_setting.inherit_from other_settings.point_in_time_copy

endpoints.each do |e|
e.reset_routes!
end
endpoints.each(&:reset_routes!)

@routes = nil
end
Expand Down
1 change: 0 additions & 1 deletion lib/grape/dsl/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def config_context.success(*args)
def config_context.failure(*args)
http_codes(*args)
end

end
end
end
Expand Down
Loading

0 comments on commit b22da9c

Please sign in to comment.