Skip to content

Commit fd939cf

Browse files
author
Daniel Mikusa
authored
Fixes rubocop violations (#941)
- Disable empty blocks under spec tests - Disable string concat style check - Change lint name to MissingSuper - Change `ENV[..]` usage to `ENV.fetch(..., nil)` - Set max for RSpec/MultipleMemoizedHelpers to 10, some tests have a lot of `let(..)` blocks - Set RSpec/VerifiedDoubleReference to enforce string style - Consistently use Naming/VariableNumber, some outliers were snake_case and switched to normalcase - Disable Lint/UselessMethodDefinition in a few specs where it's necessary - Remove some unnecessary whitespace, char groups and escaping in regex blocks - Use `be_nil` instead of `be nil` - Disable Style/GlobalStdStream checks for spec helper - Reduce complexity of versions_tasks and validate - Disable helper limit MultipleMemoizedHelpers for droplet helper - Make the order explicit in a few places by adding parends - Switch from ifelse to case - Use File.write - Remove empty blocks - Fixes all string alignment issues - Fixes all string too long issues - Ignore Ruby 2.6 lints about array slicing since we still need to support Ruby 2.5 - Use an explicit kwargs to be compatible with deprecations and removal in Ruby 2.7 and 3.0 - Bump RubyMine tests to reflect supported version 2.5, 2.7 and 3.0 - Include missing require in filtering_filename_spec.rb that caused it to fail in RubyMine - Freeze const made from dynamics - Adjust kwarg expansion so it's compliant for Ruby 3.0 (this requires some version specific behavior in the spec tests) Signed-off-by: Daniel Mikusa <[email protected]>
1 parent 80d599d commit fd939cf

File tree

87 files changed

+785
-574
lines changed

Some content is hidden

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

87 files changed

+785
-574
lines changed

.idea/runConfigurations/All_Tests__2_5_.xml

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/All_Tests__2_7_.xml

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/All_Tests__2_6_.xml renamed to .idea/runConfigurations/All_Tests__3_0_.xml

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Without_Integration_Tests__2_5_.xml

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Without_Integration_Tests__2_7_.xml

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Without_Integration_Tests__2_6_.xml renamed to .idea/runConfigurations/Without_Integration_Tests__3_0_.xml

+6-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.rubocop.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require: rubocop-rspec
33

44
AllCops:
55
NewCops: enable
6+
SuggestExtensions: false
67
Exclude:
78
- 'build/**/*'
89
Layout/EmptyLinesAroundBlockBody:
@@ -17,7 +18,7 @@ Layout/LineLength:
1718
Layout/MultilineOperationIndentation:
1819
Enabled: false
1920
Metrics/AbcSize:
20-
Max: 25
21+
Max: 25
2122
Metrics/BlockLength:
2223
Exclude:
2324
- 'spec/**/*.rb'
@@ -53,5 +54,20 @@ Style/Documentation:
5354
Enabled: false
5455
Style/FormatStringToken:
5556
Enabled: false
56-
Style/MethodMissingSuper:
57+
Lint/MissingSuper:
58+
Enabled: false
59+
Style/StringConcatenation:
60+
Enabled: false
61+
Lint/EmptyBlock:
62+
Exclude:
63+
- 'spec/**/*.rb'
64+
RSpec/MultipleMemoizedHelpers:
65+
Max: 10
66+
RSpec/VerifiedDoubleReference:
67+
EnforcedStyle: string
68+
Style/OptionalBooleanParameter:
5769
Enabled: false
70+
Lint/RedundantCopDisableDirective:
71+
Enabled: false # disabled as this can be tough to manage across multiple ruby versions
72+
Style/RedundantFreeze:
73+
Enabled: false # enable when we only support ruby 3.0+

Gemfile.lock

+42-38
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,59 @@ GEM
33
specs:
44
addressable (2.8.0)
55
public_suffix (>= 2.0.2, < 5.0)
6-
ast (2.4.0)
7-
crack (0.4.3)
8-
safe_yaml (~> 1.0.0)
9-
diff-lcs (1.3)
6+
ast (2.4.2)
7+
crack (0.4.5)
8+
rexml
9+
diff-lcs (1.5.0)
1010
hashdiff (1.0.1)
11-
jaro_winkler (1.5.4)
12-
parallel (1.19.1)
13-
parser (2.7.1.1)
14-
ast (~> 2.4.0)
15-
public_suffix (4.0.6)
16-
rainbow (3.0.0)
17-
rake (13.0.1)
11+
parallel (1.22.1)
12+
parser (3.1.2.0)
13+
ast (~> 2.4.1)
14+
public_suffix (4.0.7)
15+
rainbow (3.1.1)
16+
rake (13.0.6)
1817
redcarpet (3.5.1)
18+
regexp_parser (2.3.1)
1919
rexml (3.2.5)
20-
rspec (3.9.0)
21-
rspec-core (~> 3.9.0)
22-
rspec-expectations (~> 3.9.0)
23-
rspec-mocks (~> 3.9.0)
24-
rspec-core (3.9.1)
25-
rspec-support (~> 3.9.1)
26-
rspec-expectations (3.9.1)
20+
rspec (3.11.0)
21+
rspec-core (~> 3.11.0)
22+
rspec-expectations (~> 3.11.0)
23+
rspec-mocks (~> 3.11.0)
24+
rspec-core (3.11.0)
25+
rspec-support (~> 3.11.0)
26+
rspec-expectations (3.11.0)
2727
diff-lcs (>= 1.2.0, < 2.0)
28-
rspec-support (~> 3.9.0)
29-
rspec-mocks (3.9.1)
28+
rspec-support (~> 3.11.0)
29+
rspec-mocks (3.11.1)
3030
diff-lcs (>= 1.2.0, < 2.0)
31-
rspec-support (~> 3.9.0)
32-
rspec-support (3.9.2)
33-
rubocop (0.82.0)
34-
jaro_winkler (~> 1.5.1)
31+
rspec-support (~> 3.11.0)
32+
rspec-support (3.11.0)
33+
rubocop (1.28.2)
3534
parallel (~> 1.10)
36-
parser (>= 2.7.0.1)
35+
parser (>= 3.1.0.0)
3736
rainbow (>= 2.2.2, < 4.0)
37+
regexp_parser (>= 1.8, < 3.0)
3838
rexml
39+
rubocop-ast (>= 1.17.0, < 2.0)
3940
ruby-progressbar (~> 1.7)
40-
unicode-display_width (>= 1.4.0, < 2.0)
41-
rubocop-rspec (1.38.1)
42-
rubocop (>= 0.68.1)
43-
ruby-progressbar (1.10.1)
44-
rubyzip (2.3.0)
45-
safe_yaml (1.0.5)
41+
unicode-display_width (>= 1.4.0, < 3.0)
42+
rubocop-ast (1.17.0)
43+
parser (>= 3.1.1.0)
44+
rubocop-rspec (2.10.0)
45+
rubocop (~> 1.19)
46+
ruby-progressbar (1.11.0)
47+
rubyzip (2.3.2)
4648
tee (1.0.0)
47-
terminal-table (1.8.0)
48-
unicode-display_width (~> 1.1, >= 1.1.1)
49-
unicode-display_width (1.7.0)
50-
webmock (3.8.3)
51-
addressable (>= 2.3.6)
49+
terminal-table (3.0.2)
50+
unicode-display_width (>= 1.1.1, < 3)
51+
unicode-display_width (2.1.0)
52+
webmock (3.14.0)
53+
addressable (>= 2.8.0)
5254
crack (>= 0.3.2)
5355
hashdiff (>= 0.4.0, < 2.0.0)
54-
yard (0.9.24)
56+
webrick (1.7.0)
57+
yard (0.9.27)
58+
webrick (~> 1.7.0)
5559

5660
PLATFORMS
5761
ruby
@@ -69,4 +73,4 @@ DEPENDENCIES
6973
yard
7074

7175
BUNDLED WITH
72-
2.2.16
76+
2.3.12

0 commit comments

Comments
 (0)