Skip to content

Commit d58dc0a

Browse files
authored
Merge pull request #1941 from ericproulx/frozen_string_literal
frozen_string_literal: true
2 parents 41dced0 + f1f4e0d commit d58dc0a

File tree

261 files changed

+612
-56
lines changed

Some content is hidden

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

261 files changed

+612
-56
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: 2.1
2+
TargetRubyVersion: 2.4
33
Include:
44
- Dangerfile
55
- gemfiles/*.gemfile

.rubocop_todo.yml

Lines changed: 47 additions & 9 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-12-20 21:38:24 +0000 using RuboCop version 0.51.0.
3+
# on 2019-12-09 18:07:42 +0100 using RuboCop version 0.51.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
@@ -26,41 +26,47 @@ Lint/RescueWithoutErrorClass:
2626
Exclude:
2727
- 'lib/grape/validations/validators/coerce.rb'
2828

29-
# Offense count: 47
29+
# Offense count: 1
30+
# Cop supports --auto-correct.
31+
Lint/UnneededRequireStatement:
32+
Exclude:
33+
- 'lib/grape.rb'
34+
35+
# Offense count: 46
3036
Metrics/AbcSize:
3137
Max: 44
3238

33-
# Offense count: 4
39+
# Offense count: 7
3440
# Configuration parameters: CountComments, ExcludedMethods.
3541
Metrics/BlockLength:
3642
Max: 182
3743

38-
# Offense count: 9
44+
# Offense count: 10
3945
# Configuration parameters: CountComments.
4046
Metrics/ClassLength:
4147
Max: 302
4248

43-
# Offense count: 31
49+
# Offense count: 30
4450
Metrics/CyclomaticComplexity:
4551
Max: 14
4652

47-
# Offense count: 1234
53+
# Offense count: 1300
4854
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
4955
# URISchemes: http, https
5056
Metrics/LineLength:
5157
Max: 215
5258

53-
# Offense count: 57
59+
# Offense count: 60
5460
# Configuration parameters: CountComments.
5561
Metrics/MethodLength:
56-
Max: 34
62+
Max: 33
5763

5864
# Offense count: 12
5965
# Configuration parameters: CountComments.
6066
Metrics/ModuleLength:
6167
Max: 220
6268

63-
# Offense count: 21
69+
# Offense count: 22
6470
Metrics/PerceivedComplexity:
6571
Max: 14
6672

@@ -74,8 +80,40 @@ Naming/FileName:
7480
- 'Guardfile'
7581
- 'Rakefile'
7682

83+
# Offense count: 1
84+
# Cop supports --auto-correct.
85+
Performance/RegexpMatch:
86+
Exclude:
87+
- 'lib/grape/middleware/versioner/path.rb'
88+
7789
# Offense count: 2
7890
# Configuration parameters: SupportedStyles.
7991
# SupportedStyles: annotated, template
8092
Style/FormatStringToken:
8193
EnforcedStyle: template
94+
95+
# Offense count: 1
96+
# Cop supports --auto-correct.
97+
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
98+
# SupportedStyles: predicate, comparison
99+
Style/NumericPredicate:
100+
Exclude:
101+
- 'spec/**/*'
102+
- 'lib/grape/middleware/formatter.rb'
103+
104+
# Offense count: 12
105+
# Cop supports --auto-correct.
106+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil.
107+
Style/SafeNavigation:
108+
Exclude:
109+
- 'lib/grape/api/instance.rb'
110+
- 'lib/grape/dsl/desc.rb'
111+
- 'lib/grape/dsl/helpers.rb'
112+
- 'lib/grape/dsl/inside_route.rb'
113+
- 'lib/grape/dsl/routing.rb'
114+
- 'lib/grape/endpoint.rb'
115+
- 'lib/grape/middleware/error.rb'
116+
- 'lib/grape/middleware/versioner/accept_version_header.rb'
117+
- 'lib/grape/middleware/versioner/header.rb'
118+
- 'lib/grape/middleware/versioner/param.rb'
119+
- 'lib/grape/middleware/versioner/path.rb'

Appraisals

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
appraise 'rails-5' do
24
gem 'rails', '5.2.1'
35
end

CHANGELOG.md

Lines changed: 1 addition & 0 deletions

Dangerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
danger.import_dangerfile(gem: 'ruby-grape-danger')
24
toc.check

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# when changing this file, run appraisal install ; rubocop -a gemfiles/*.gemfile
24

35
source 'https://rubygems.org'

Guardfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
guard :rspec, all_on_start: true, cmd: 'bundle exec rspec' do
24
watch(%r{^spec/.+_spec\.rb$})
35
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rubygems'
24
require 'bundler'
35
Bundler.setup :default, :test, :development

benchmark/nested_params.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'grape'
24
require 'benchmark/ips'
35

benchmark/simple.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
24
require 'grape'
35
require 'benchmark/ips'

0 commit comments

Comments
 (0)