Skip to content

Commit 7e9c064

Browse files
authored
Merge pull request #87 from dblock/rubocop-0.53.0
Upgraded RuboCop to 0.53.0.
2 parents 1995ba4 + 791c1b0 commit 7e9c064

File tree

7 files changed

+51
-32
lines changed

7 files changed

+51
-32
lines changed

.rubocop_todo.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2017-10-09 10:22:52 -0500 using RuboCop version 0.41.2.
3+
# on 2018-03-14 14:59:23 -0400 using RuboCop version 0.53.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9+
# Offense count: 1
10+
# Configuration parameters: Include.
11+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
12+
Bundler/DuplicatedGem:
13+
Exclude:
14+
- 'Gemfile'
15+
916
# Offense count: 1
1017
Metrics/AbcSize:
11-
Max: 18
18+
Max: 17
19+
20+
# Offense count: 23
21+
# Configuration parameters: CountComments, ExcludedMethods.
22+
Metrics/BlockLength:
23+
Max: 133
1224

1325
# Offense count: 1
1426
Metrics/CyclomaticComplexity:
1527
Max: 9
1628

17-
# Offense count: 1
18-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
19-
# URISchemes: http, https
20-
Metrics/LineLength:
21-
Max: 87
22-
2329
# Offense count: 1
2430
# Configuration parameters: CountComments.
2531
Metrics/MethodLength:
26-
Max: 18
32+
Max: 15
2733

2834
# Offense count: 1
2935
Metrics/PerceivedComplexity:
30-
Max: 11
36+
Max: 10
37+
38+
# Offense count: 2
39+
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
40+
# 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
41+
Naming/FileName:
42+
Exclude:
43+
- 'lib/grape-active_model_serializers.rb'
44+
- 'spec/grape-active_model_serializers_spec.rb'
3145

3246
# Offense count: 5
3347
Style/Documentation:
@@ -40,9 +54,14 @@ Style/Documentation:
4054
- 'lib/grape-active_model_serializers/options_builder.rb'
4155
- 'lib/grape-active_model_serializers/serializer_resolver.rb'
4256

43-
# Offense count: 2
44-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts.
45-
Style/FileName:
57+
# Offense count: 1
58+
# Configuration parameters: MinBodyLength.
59+
Style/GuardClause:
4660
Exclude:
47-
- 'lib/grape-active_model_serializers.rb'
48-
- 'spec/grape-active_model_serializers_spec.rb'
61+
- 'lib/grape-active_model_serializers/serializer_resolver.rb'
62+
63+
# Offense count: 2
64+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
65+
# URISchemes: http, https
66+
Metrics/LineLength:
67+
Max: 87

Gemfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ else
1010
end
1111

1212
group :test do
13-
gem 'sqlite3'
14-
gem 'sequel', '~> 4.37', require: false
13+
gem 'rack-test'
1514
gem 'ruby-grape-danger', '~> 0.1.0', require: false
15+
gem 'sequel', '~> 4.37', require: false
16+
gem 'sqlite3'
17+
end
18+
19+
group :development, :test do
20+
gem 'guard-rspec'
21+
gem 'listen', '~> 3.0.7'
22+
gem 'rake'
23+
gem 'rspec'
24+
gem 'rubocop', '0.53.0'
1625
end

Rakefile

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ end
1111
require 'rubocop/rake_task'
1212
RuboCop::RakeTask.new(:rubocop)
1313

14-
task default: [:rubocop, :spec]
14+
task default: %i[rubocop spec]

grape-active_model_serializers.gemspec

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,4 @@ Gem::Specification.new do |gem|
1818

1919
gem.add_dependency 'grape', '>= 0.8.0'
2020
gem.add_dependency 'active_model_serializers', '>= 0.10.0'
21-
22-
gem.add_development_dependency 'listen', '~> 3.0.7'
23-
gem.add_development_dependency 'rspec'
24-
gem.add_development_dependency 'rack-test'
25-
gem.add_development_dependency 'rake'
26-
gem.add_development_dependency 'guard-rspec'
27-
gem.add_development_dependency 'rubocop', '0.41.2'
2821
end

lib/grape-active_model_serializers/endpoint_extension.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ def render(resources, extra_options = {})
5050
resources
5151
end
5252

53-
def default_serializer_options
54-
end
53+
def default_serializer_options; end
5554

56-
def url_options
57-
end
55+
def url_options; end
5856
end
5957

6058
Endpoint.send(:include, EndpointExtension)

lib/grape-active_model_serializers/options_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ def initialize(resource, env)
77
end
88

99
def options
10-
@options ||= (
10+
@options ||= begin
1111
options = endpoint_options
1212
options[:scope] = endpoint unless options.key?(:scope)
1313
options.merge!(default_root_options) unless options.key?(:root)
1414
options.merge!(meta_options)
1515
options.merge!(adapter_options)
1616
options.merge!(extra_options)
1717
options
18-
)
18+
end
1919
end
2020

2121
private

spec/grape-active_model_serializers/error_formatter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe Grape::ErrorFormatter::ActiveModelSerializers do
55
subject { Grape::ErrorFormatter::ActiveModelSerializers }
66
let(:backtrace) { ['Line:1'] }
7-
let(:options) { Hash.new }
7+
let(:options) { {} }
88
let(:env) { { 'api.endpoint' => app.endpoints.first } }
99
let(:original_exception) { StandardError.new('oh noes!') }
1010

0 commit comments

Comments
 (0)