Skip to content

Commit acef1f6

Browse files
authored
fixes rubocop 0.54.0 offenses (#301)
1 parent 1bfa7f3 commit acef1f6

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

.rubocop_todo.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2018-01-11 18:20:10 +0100 using RuboCop version 0.52.1.
3+
# on 2018-03-28 21:26:18 +0200 using RuboCop version 0.54.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
@@ -11,32 +11,39 @@ Lint/AmbiguousBlockAssociation:
1111
Exclude:
1212
- 'spec/grape_entity/exposure/represent_exposure_spec.rb'
1313

14-
# Offense count: 6
14+
# Offense count: 5
1515
Metrics/AbcSize:
16-
Max: 32
16+
Max: 25
1717

18-
# Offense count: 35
18+
# Offense count: 39
1919
# Configuration parameters: CountComments, ExcludedMethods.
2020
Metrics/BlockLength:
2121
Max: 1632
2222

23-
# Offense count: 2
23+
# Offense count: 1
2424
# Configuration parameters: CountComments.
2525
Metrics/ClassLength:
26-
Max: 210
26+
Max: 205
2727

28-
# Offense count: 2
28+
# Offense count: 1
2929
Metrics/CyclomaticComplexity:
30-
Max: 11
30+
Max: 10
3131

32-
# Offense count: 7
32+
# Offense count: 6
3333
# Configuration parameters: CountComments.
3434
Metrics/MethodLength:
35-
Max: 28
35+
Max: 26
3636

37-
# Offense count: 2
37+
# Offense count: 1
3838
Metrics/PerceivedComplexity:
39-
Max: 13
39+
Max: 11
40+
41+
# Offense count: 3
42+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
43+
# AllowedNames: io, id, to
44+
Naming/UncommunicativeMethodParamName:
45+
Exclude:
46+
- 'spec/grape_entity/entity_spec.rb'
4047

4148
# Offense count: 1
4249
Style/EvalWithLocation:
@@ -51,7 +58,7 @@ Style/SymbolProc:
5158
Exclude:
5259
- 'spec/grape_entity/entity_spec.rb'
5360

54-
# Offense count: 250
61+
# Offense count: 272
5562
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
5663
# URISchemes: http, https
5764
Metrics/LineLength:

grape-entity.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
3+
$LOAD_PATH.push File.expand_path('lib', __dir__)
44
require 'grape_entity/version'
55

66
Gem::Specification.new do |s|

lib/grape_entity/entity.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,12 @@ def delegate_attribute(attribute)
516516
alias as_json serializable_hash
517517

518518
def to_json(options = {})
519-
options = options.to_h if options && options.respond_to?(:to_h)
519+
options = options.to_h if options&.respond_to?(:to_h)
520520
MultiJson.dump(serializable_hash(options))
521521
end
522522

523523
def to_xml(options = {})
524-
options = options.to_h if options && options.respond_to?(:to_h)
524+
options = options.to_h if options&.respond_to?(:to_h)
525525
serializable_hash(options).to_xml(options)
526526
end
527527

0 commit comments

Comments
 (0)