Skip to content

Commit b22da9c

Browse files
committed
Upgraded RuboCop to 0.28.0.
1 parent f613e67 commit b22da9c

File tree

108 files changed

+953
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+953
-1043
lines changed

.rubocop.yml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,4 @@ AllCops:
44
- bin/**/*
55
- gemfiles/**/*
66

7-
LineLength:
8-
Enabled: false
9-
10-
MethodLength:
11-
Enabled: false
12-
13-
ClassLength:
14-
Enabled: false
15-
16-
Documentation:
17-
# don't require classes to be documented
18-
Enabled: false
19-
20-
CollectionMethods:
21-
# don't prefer map to collect, recuce to inject
22-
Enabled: false
23-
24-
Encoding:
25-
# no need to always specify encoding
26-
Enabled: false
27-
28-
StringLiterals:
29-
# use single or double-quoted strings, as you please
30-
Enabled: false
31-
32-
Void:
33-
# == operator used in void context in specs
34-
Enabled: false
35-
36-
SignalException:
37-
# prefer raise to fail
38-
EnforcedStyle: only_raise
39-
40-
RaiseArgs:
41-
# don't care for what kind of raise
42-
Enabled: false
43-
44-
PerlBackrefs:
45-
# TODO: regular expression matching with $1, $2, etc.
46-
Enabled: false
47-
48-
BlockNesting:
49-
# TODO: fix too much nesting
50-
Max: 4
51-
52-
Lambda:
53-
# TODO: replace all lambda with -> or Proc
54-
Enabled: false
55-
56-
Blocks:
57-
# allow multi-line blocks like expect { }
58-
Enabled: false
59-
60-
WordArray:
61-
# %w vs. [ '', ... ]
62-
Enabled: false
63-
64-
CyclomaticComplexity:
65-
Enabled: false
66-
67-
DoubleNegation:
68-
Enabled: false
69-
70-
PredicateName:
71-
Enabled: false
72-
737
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

Lines changed: 78 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,125 @@
11
# This configuration was generated by `rubocop --auto-gen-config`
2-
# on 2014-08-12 13:16:39 +0200 using RuboCop version 0.24.1.
2+
# on 2014-12-14 14:50:02 -0500 using RuboCop version 0.28.0.
33
# The point is for the user to remove these configuration records
44
# one by one as the offenses are removed from the code base.
55
# Note that changes in the inspected code, or installation of new
66
# versions of RuboCop, may require this file to be generated again.
77

8-
# Offense count: 28
8+
# Offense count: 29
99
# Cop supports --auto-correct.
1010
Lint/UnusedBlockArgument:
1111
Enabled: false
1212

13-
# Offense count: 30
13+
# Offense count: 25
1414
# Cop supports --auto-correct.
1515
Lint/UnusedMethodArgument:
1616
Enabled: false
1717

18-
# Offense count: 5
18+
# Offense count: 35
19+
Metrics/AbcSize:
20+
Max: 51
21+
22+
# Offense count: 1
23+
Metrics/BlockNesting:
24+
Max: 4
25+
26+
# Offense count: 4
27+
# Configuration parameters: CountComments.
28+
Metrics/ClassLength:
29+
Max: 243
30+
31+
# Offense count: 15
32+
Metrics/CyclomaticComplexity:
33+
Max: 21
34+
35+
# Offense count: 546
36+
# Configuration parameters: AllowURI, URISchemes.
37+
Metrics/LineLength:
38+
Max: 198
39+
40+
# Offense count: 42
41+
# Configuration parameters: CountComments.
42+
Metrics/MethodLength:
43+
Max: 35
44+
45+
# Offense count: 13
46+
Metrics/PerceivedComplexity:
47+
Max: 21
48+
49+
# Offense count: 26
50+
# Cop supports --auto-correct.
51+
Style/Blocks:
52+
Enabled: false
53+
54+
# Offense count: 6
1955
# Cop supports --auto-correct.
2056
# Configuration parameters: EnforcedStyle, SupportedStyles.
2157
Style/ClassCheck:
2258
Enabled: false
2359

24-
# Offense count: 6
60+
# Offense count: 157
61+
Style/Documentation:
62+
Enabled: false
63+
64+
# Offense count: 7
65+
Style/DoubleNegation:
66+
Enabled: false
67+
68+
# Offense count: 5
2569
Style/EachWithObject:
2670
Enabled: false
2771

28-
# Offense count: 11
72+
# Offense count: 1
73+
Style/EmptyElse:
74+
Enabled: false
75+
76+
# Offense count: 14
2977
# Configuration parameters: MinBodyLength.
3078
Style/GuardClause:
3179
Enabled: false
3280

33-
# Offense count: 1
81+
# Offense count: 3
3482
# Cop supports --auto-correct.
3583
# Configuration parameters: EnforcedStyle, SupportedStyles.
3684
Style/HashSyntax:
3785
Enabled: false
3886

39-
# Offense count: 14
87+
# Offense count: 15
4088
# Cop supports --auto-correct.
4189
Style/IndentArray:
4290
Enabled: false
4391

44-
# Offense count: 2
45-
# Cop supports --auto-correct.
46-
# Configuration parameters: EnforcedStyle, SupportedStyles.
47-
Style/IndentHash:
48-
Enabled: true
92+
# Offense count: 18
93+
Style/Lambda:
94+
Enabled: false
4995

50-
# Offense count: 3
51-
# Configuration parameters: EnforcedStyle, SupportedStyles.
96+
# Offense count: 1
97+
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
5298
Style/Next:
5399
Enabled: false
54100

55-
# Offense count: 2
101+
# Offense count: 3
56102
# Cop supports --auto-correct.
57103
# Configuration parameters: PreferredDelimiters.
58104
Style/PercentLiteralDelimiters:
59105
Enabled: false
60106

61-
# Offense count: 1
107+
# Offense count: 3
108+
# Configuration parameters: NamePrefix, NamePrefixBlacklist.
109+
Style/PredicateName:
110+
Enabled: false
111+
112+
# Offense count: 9
113+
# Configuration parameters: EnforcedStyle, SupportedStyles.
114+
Style/RaiseArgs:
115+
Enabled: false
116+
117+
# Offense count: 4
118+
# Configuration parameters: MaxSlashes.
119+
Style/RegexpLiteral:
120+
Enabled: false
121+
122+
# Offense count: 4
62123
# Cop supports --auto-correct.
63124
# Configuration parameters: EnforcedStyle, SupportedStyles.
64125
Style/SpaceBeforeBlockBraces:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source 'http://rubygems.org'
33
gemspec
44

55
group :development, :test do
6-
gem 'rubocop', '~> 0.24.1'
6+
gem 'rubocop', '~> 0.28.0'
77
gem 'guard'
88
gem 'guard-rspec'
99
gem 'guard-rubocop'

Guardfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
guard :rspec, all_on_start: true, cmd: 'bundle exec rspec' do
22
watch(%r{^spec/.+_spec\.rb$})
33
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4-
watch('spec/spec_helper.rb') { "spec" }
4+
watch('spec/spec_helper.rb') { 'spec' }
55
end
66

77
guard :rubocop do

Rakefile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,32 @@ begin
3737
end
3838

3939
namespace :pages do
40-
41-
desc "Check out gh-pages."
40+
desc 'Check out gh-pages.'
4241
task :checkout do
4342
dir = File.dirname(__FILE__) + '/../grape.doc'
4443
unless Dir.exist?(dir)
4544
Dir.mkdir(dir)
4645
Dir.chdir(dir) do
47-
system("git init")
48-
system("git remote add origin [email protected]:intridea/grape.git")
49-
system("git pull")
50-
system("git checkout gh-pages")
46+
system('git init')
47+
system('git remote add origin [email protected]:intridea/grape.git')
48+
system('git pull')
49+
system('git checkout gh-pages')
5150
end
5251
end
5352
end
5453

5554
desc 'Generate and publish YARD docs to GitHub pages.'
5655
task :publish => ['doc:pages:checkout', 'doc:pages'] do
5756
Dir.chdir(File.dirname(__FILE__) + '/../grape.doc') do
58-
system("git checkout gh-pages")
59-
system("git add .")
60-
system("git add -u")
57+
system('git checkout gh-pages')
58+
system('git add .')
59+
system('git add -u')
6160
system("git commit -m 'Generating docs for version #{Grape::VERSION}.'")
62-
system("git push origin gh-pages")
61+
system('git push origin gh-pages')
6362
end
6463
end
6564
end
6665
end
6766
rescue LoadError
68-
puts "You need to install YARD."
67+
puts 'You need to install YARD.'
6968
end

gemfiles/rails_3.gemfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# This file was generated by Appraisal
22

3-
source "http://rubygems.org"
3+
source 'http://rubygems.org'
44

5-
gem "rails", "3.2.19"
5+
gem 'rails', '3.2.19'
66

77
group :development, :test do
8-
gem "rubocop", "~> 0.24.1"
9-
gem "guard"
10-
gem "guard-rspec"
11-
gem "guard-rubocop"
8+
gem 'rubocop', '~> 0.28.0'
9+
gem 'guard'
10+
gem 'guard-rspec'
11+
gem 'guard-rubocop'
1212
end
1313

14-
gemspec :path => "../"
14+
gemspec :path => '../'

gemfiles/rails_4.gemfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# This file was generated by Appraisal
22

3-
source "http://rubygems.org"
3+
source 'http://rubygems.org'
44

5-
gem "rails", "4.1.6"
5+
gem 'rails', '4.1.6'
66

77
group :development, :test do
8-
gem "rubocop", "~> 0.24.1"
9-
gem "guard"
10-
gem "guard-rspec"
11-
gem "guard-rubocop"
8+
gem 'rubocop', '~> 0.28.0'
9+
gem 'guard'
10+
gem 'guard-rspec'
11+
gem 'guard-rubocop'
1212
end
1313

14-
gemspec :path => "../"
14+
gemspec :path => '../'

grape.gemspec

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
$:.push File.expand_path("../lib", __FILE__)
2-
require "grape/version"
1+
$:.push File.expand_path('../lib', __FILE__)
2+
require 'grape/version'
33

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

15-
s.rubyforge_project = "grape"
15+
s.rubyforge_project = 'grape'
1616

1717
s.add_runtime_dependency 'rack', '>= 1.3.0'
1818
s.add_runtime_dependency 'rack-mount'
@@ -39,5 +39,5 @@ Gem::Specification.new do |s|
3939
s.files = `git ls-files`.split("\n")
4040
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
4141
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
42-
s.require_paths = ["lib"]
42+
s.require_paths = ['lib']
4343
end

lib/backports/active_support/deep_dup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Array
2828
# array[1][2] #=> nil
2929
# dup[1][2] #=> 4
3030
def deep_dup
31-
map { |it| it.deep_dup }
31+
map(&:deep_dup)
3232
end
3333
end
3434

lib/grape/api.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def prepare_routes
6464
# block passed in. Allows for simple 'before' setups
6565
# of settings stack pushes.
6666
def nest(*blocks, &block)
67-
blocks.reject! { |b| b.nil? }
67+
blocks.reject!(&:nil?)
6868
if blocks.any?
6969
instance_eval(&block) if block_given?
7070
blocks.each { |b| instance_eval(&b) }
@@ -82,9 +82,7 @@ def inherited(subclass)
8282
def inherit_settings(other_settings)
8383
top_level_setting.inherit_from other_settings.point_in_time_copy
8484

85-
endpoints.each do |e|
86-
e.reset_routes!
87-
end
85+
endpoints.each(&:reset_routes!)
8886

8987
@routes = nil
9088
end

lib/grape/dsl/configuration.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def config_context.success(*args)
6464
def config_context.failure(*args)
6565
http_codes(*args)
6666
end
67-
6867
end
6968
end
7069
end

0 commit comments

Comments
 (0)