Skip to content

Commit e0b7357

Browse files
committed
Merge pull request #1030 from dblock/rubocop-0.31.0
Upgraded RuboCop 0.31.0.
2 parents 03c279d + 65d5725 commit e0b7357

Some content is hidden

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

54 files changed

+184
-247
lines changed

.rubocop_todo.yml

Lines changed: 12 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
# This configuration was generated by `rubocop --auto-gen-config`
2-
# on 2015-06-03 09:20:43 -0400 using RuboCop version 0.29.1.
2+
# on 2015-06-04 09:15:17 -0400 using RuboCop version 0.31.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: 33
9-
# Cop supports --auto-correct.
10-
Lint/UnusedBlockArgument:
11-
Enabled: false
12-
13-
# Offense count: 27
14-
# Cop supports --auto-correct.
15-
Lint/UnusedMethodArgument:
16-
Enabled: false
17-
188
# Offense count: 37
199
Metrics/AbcSize:
2010
Max: 48
@@ -32,7 +22,7 @@ Metrics/ClassLength:
3222
Metrics/CyclomaticComplexity:
3323
Max: 20
3424

35-
# Offense count: 676
25+
# Offense count: 675
3626
# Configuration parameters: AllowURI, URISchemes.
3727
Metrics/LineLength:
3828
Max: 198
@@ -42,19 +32,19 @@ Metrics/LineLength:
4232
Metrics/MethodLength:
4333
Max: 35
4434

35+
# Offense count: 8
36+
# Configuration parameters: CountComments.
37+
Metrics/ModuleLength:
38+
Max: 243
39+
4540
# Offense count: 17
4641
Metrics/PerceivedComplexity:
4742
Max: 22
4843

49-
# Offense count: 46
50-
# Cop supports --auto-correct.
51-
Style/Blocks:
52-
Enabled: false
53-
54-
# Offense count: 6
44+
# Offense count: 26
5545
# Cop supports --auto-correct.
56-
# Configuration parameters: EnforcedStyle, SupportedStyles.
57-
Style/ClassCheck:
46+
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
47+
Style/BlockDelimiters:
5848
Enabled: false
5949

6050
# Offense count: 174
@@ -69,40 +59,18 @@ Style/DoubleNegation:
6959
Style/EachWithObject:
7060
Enabled: false
7161

72-
# Offense count: 1
73-
Style/EmptyElse:
74-
Enabled: false
75-
7662
# Offense count: 15
7763
# Configuration parameters: MinBodyLength.
7864
Style/GuardClause:
7965
Enabled: false
8066

81-
# Offense count: 3
82-
# Cop supports --auto-correct.
83-
# Configuration parameters: EnforcedStyle, SupportedStyles.
84-
Style/HashSyntax:
85-
Enabled: false
86-
87-
# Offense count: 15
88-
# Cop supports --auto-correct.
89-
Style/IndentArray:
90-
Enabled: false
91-
92-
# Offense count: 20
67+
# Offense count: 4
9368
# Cop supports --auto-correct.
9469
Style/Lambda:
9570
Enabled: false
9671

97-
# Offense count: 1
98-
# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
99-
Style/Next:
100-
Enabled: false
101-
10272
# Offense count: 3
103-
# Cop supports --auto-correct.
104-
# Configuration parameters: PreferredDelimiters.
105-
Style/PercentLiteralDelimiters:
73+
Style/MultilineTernaryOperator:
10674
Enabled: false
10775

10876
# Offense count: 3
@@ -114,29 +82,3 @@ Style/PredicateName:
11482
# Configuration parameters: EnforcedStyle, SupportedStyles.
11583
Style/RaiseArgs:
11684
Enabled: false
117-
118-
# Offense count: 4
119-
# Configuration parameters: MaxSlashes.
120-
Style/RegexpLiteral:
121-
Enabled: false
122-
123-
# Offense count: 11
124-
# Cop supports --auto-correct.
125-
# Configuration parameters: EnforcedStyle, SupportedStyles.
126-
Style/SpaceBeforeBlockBraces:
127-
Enabled: false
128-
129-
# Offense count: 12
130-
# Cop supports --auto-correct.
131-
Style/SpaceBeforeSemicolon:
132-
Enabled: false
133-
134-
# Offense count: 1
135-
# Cop supports --auto-correct.
136-
Style/SpecialGlobalVars:
137-
Enabled: false
138-
139-
# Offense count: 2
140-
# Cop supports --auto-correct.
141-
Style/UnneededPercentQ:
142-
Enabled: false

Gemfile

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

55
group :development, :test do
6-
gem 'rubocop', '~> 0.29.1'
6+
gem 'rubocop', '~> 0.31.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
@@ -5,6 +5,6 @@ guard :rspec, all_on_start: true, cmd: 'bundle exec rspec' do
55
end
66

77
guard :rubocop do
8-
watch(%r{.+\.rb$})
8+
watch(/.+\.rb$/)
99
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
1010
end

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ begin
5252
end
5353

5454
desc 'Generate and publish YARD docs to GitHub pages.'
55-
task :publish => ['doc:pages:checkout', 'doc:pages'] do
55+
task publish: ['doc:pages:checkout', 'doc:pages'] do
5656
Dir.chdir(File.dirname(__FILE__) + '/../grape.doc') do
5757
system('git checkout gh-pages')
5858
system('git add .')

gemfiles/rails_3.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
55
gem 'rails', '3.2.19'
66

77
group :development, :test do
8-
gem 'rubocop', '~> 0.29.1'
8+
gem 'rubocop', '~> 0.31.0'
99
gem 'guard'
1010
gem 'guard-rspec'
1111
gem 'guard-rubocop'

gemfiles/rails_4.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
55
gem 'rails', '4.1.6'
66

77
group :development, :test do
8-
gem 'rubocop', '~> 0.29.1'
8+
gem 'rubocop', '~> 0.31.0'
99
gem 'guard'
1010
gem 'guard-rspec'
1111
gem 'guard-rubocop'

grape.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$:.push File.expand_path('../lib', __FILE__)
1+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
22
require 'grape/version'
33

44
Gem::Specification.new do |s|
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
88
s.authors = ['Michael Bleigh']
99
s.email = ['[email protected]']
1010
s.homepage = 'https://github.com/intridea/grape'
11-
s.summary = %q{A simple Ruby framework for building REST-like APIs.}
12-
s.description = %q{A Ruby framework for rapid API development with great conventions.}
11+
s.summary = 'A simple Ruby framework for building REST-like APIs.'
12+
s.description = 'A Ruby framework for rapid API development with great conventions.'
1313
s.license = 'MIT'
1414

1515
s.rubyforge_project = 'grape'

lib/grape/api.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def call!(env)
3636
# Create a scope without affecting the URL.
3737
#
3838
# @param name [Symbol] Purely placebo, just allows to name the scope to make the code more readable.
39-
def scope(name = nil, &block)
39+
def scope(_name = nil, &block)
4040
within_namespace do
4141
nest(block)
4242
end
@@ -168,7 +168,7 @@ def add_head_not_allowed_methods_and_options_methods
168168
end
169169
end
170170

171-
def without_versioning(&block)
171+
def without_versioning(&_block)
172172
old_version = self.class.namespace_inheritable(:version)
173173
old_version_options = self.class.namespace_inheritable(:version_options)
174174

@@ -181,7 +181,7 @@ def without_versioning(&block)
181181
self.class.namespace_inheritable(:version_options, old_version_options)
182182
end
183183

184-
def without_root_prefix(&block)
184+
def without_root_prefix(&_block)
185185
old_prefix = self.class.namespace_inheritable(:root_prefix)
186186

187187
self.class.namespace_inheritable_to_nil(:root_prefix)

lib/grape/cookies.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def read(request)
1212
end
1313

1414
def write(header)
15-
@cookies.select { |key, value| @send_cookies[key] == true }.each do |name, value|
15+
@cookies.select { |key, _value| @send_cookies[key] == true }.each do |name, value|
1616
cookie_value = value.is_a?(Hash) ? value : { value: value }
1717
Rack::Utils.set_cookie_header! header, name, cookie_value
1818
end

lib/grape/dsl/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def helpers(new_mod = nil, &block)
5151

5252
protected
5353

54-
def inject_api_helpers_to_mod(mod, &block)
54+
def inject_api_helpers_to_mod(mod, &_block)
5555
mod.extend(BaseHelper)
5656
yield if block_given?
5757
mod.api_changed(self)

0 commit comments

Comments
 (0)