Skip to content

Commit 2e5d673

Browse files
authored
Fix Cop deprecations and upgrade dependencies (#70)
* All cops should inherit from `RuboCop::Cop::Base` * All specs should use `expect_offense` instead of `inspect_source` * Use latest version of all `rubocop-*` gems, except `rubocop-rspec` which I've pinned to the latest version of the `2.x` series. There are some larger changes that need to be addressed in another PR. * Fixes a few RuboCop violations
1 parent 99537f8 commit 2e5d673

35 files changed

+340
-487
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
ruby: ['3.0', 3.1, 3.2]
11+
ruby: ['3.0', '3.1', '3.2', '3.3']
1212
gemfile:
1313
- Gemfile
1414

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ require:
88
AllCops:
99
NewCops: enable
1010
TargetRubyVersion: 3.0
11+
12+
Rails:
13+
Enabled: false

.rubocop_todo.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 99999 --no-auto-gen-timestamp`
3-
# using RuboCop version 1.56.0.
3+
# using RuboCop version 1.71.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: 13
10-
InternalAffairs/InheritDeprecatedCopClass:
11-
Exclude:
12-
- 'lib/rubocop/cop/betterment/active_job_performable.rb'
13-
- 'lib/rubocop/cop/betterment/allowlist_blocklist.rb'
14-
- 'lib/rubocop/cop/betterment/authorization_in_controller.rb'
15-
- 'lib/rubocop/cop/betterment/dynamic_params.rb'
16-
- 'lib/rubocop/cop/betterment/implicit_redirect_type.rb'
17-
- 'lib/rubocop/cop/betterment/memoization_with_arguments.rb'
18-
- 'lib/rubocop/cop/betterment/non_standard_actions.rb'
19-
- 'lib/rubocop/cop/betterment/server_error_assertion.rb'
20-
- 'lib/rubocop/cop/betterment/site_prism_loaded.rb'
21-
- 'lib/rubocop/cop/betterment/spec_helper_required_outside_spec_dir.rb'
22-
- 'lib/rubocop/cop/betterment/timeout.rb'
23-
- 'lib/rubocop/cop/betterment/unsafe_job.rb'
24-
- 'lib/rubocop/cop/betterment/unscoped_find.rb'
25-
269
# Offense count: 17
2710
# This cop supports safe autocorrection (--autocorrect).
2811
InternalAffairs/NodeMatcherDirective:
@@ -48,10 +31,3 @@ InternalAffairs/NumblockHandler:
4831
Performance/MapMethodChain:
4932
Exclude:
5033
- 'lib/rubocop/cop/betterment/server_error_assertion.rb'
51-
52-
# Offense count: 2
53-
# This cop supports unsafe autocorrection (--autocorrect-all).
54-
Rails/NegateInclude:
55-
Exclude:
56-
- 'lib/rubocop/cop/betterment/non_standard_actions.rb'
57-
- 'lib/rubocop/cop/betterment/unscoped_find.rb'

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ source 'https://rubygems.org'
22

33
gemspec
44

5+
# These pins are necessary for Ruby 3.0
6+
gem 'activesupport', '~> 7.1.5'
7+
gem 'nokogiri', '~> 1.17.2'
8+
gem 'securerandom', '~> 0.3.2'
9+
gem 'zeitwerk', '~> 2.6.18'
10+
511
group :development do
612
gem 'pry'
713
gem 'bundler'

Gemfile.lock

Lines changed: 107 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,191 +1,200 @@
11
PATH
22
remote: .
33
specs:
4-
betterlint (1.17.0)
5-
rubocop (~> 1.62.0)
6-
rubocop-graphql (~> 1.5.0)
7-
rubocop-performance (~> 1.21.0)
8-
rubocop-rails (~> 2.24.0)
9-
rubocop-rake (~> 0.6.0)
10-
rubocop-rspec (~> 2.28.0)
4+
betterlint (1.18.0)
5+
rubocop (~> 1.71)
6+
rubocop-graphql (~> 1.5)
7+
rubocop-performance (~> 1.23)
8+
rubocop-rails (~> 2.29)
9+
rubocop-rake (~> 0.6)
10+
rubocop-rspec (~> 2.29)
1111

1212
GEM
1313
remote: https://rubygems.org/
1414
specs:
15-
actionpack (7.1.4.1)
16-
actionview (= 7.1.4.1)
17-
activesupport (= 7.1.4.1)
15+
actionpack (7.1.5.1)
16+
actionview (= 7.1.5.1)
17+
activesupport (= 7.1.5.1)
1818
nokogiri (>= 1.8.5)
1919
racc
2020
rack (>= 2.2.4)
2121
rack-session (>= 1.0.1)
2222
rack-test (>= 0.6.3)
2323
rails-dom-testing (~> 2.2)
2424
rails-html-sanitizer (~> 1.6)
25-
actionview (7.1.4.1)
26-
activesupport (= 7.1.4.1)
25+
actionview (7.1.5.1)
26+
activesupport (= 7.1.5.1)
2727
builder (~> 3.1)
2828
erubi (~> 1.11)
2929
rails-dom-testing (~> 2.2)
3030
rails-html-sanitizer (~> 1.6)
31-
activesupport (7.1.4.1)
31+
activesupport (7.1.5.1)
3232
base64
33+
benchmark (>= 0.3)
3334
bigdecimal
3435
concurrent-ruby (~> 1.0, >= 1.0.2)
3536
connection_pool (>= 2.2.5)
3637
drb
3738
i18n (>= 1.6, < 2)
39+
logger (>= 1.4.2)
3840
minitest (>= 5.1)
3941
mutex_m
42+
securerandom (>= 0.3)
4043
tzinfo (~> 2.0)
4144
ast (2.4.2)
4245
base64 (0.2.0)
43-
bigdecimal (3.1.8)
46+
benchmark (0.4.0)
47+
bigdecimal (3.1.9)
4448
builder (3.3.0)
4549
coderay (1.1.3)
46-
concurrent-ruby (1.3.4)
47-
connection_pool (2.4.1)
50+
concurrent-ruby (1.3.5)
51+
connection_pool (2.5.0)
4852
crass (1.0.6)
49-
diff-lcs (1.5.0)
53+
date (3.4.1)
54+
diff-lcs (1.5.1)
5055
drb (2.2.1)
51-
erubi (1.13.0)
52-
i18n (1.14.6)
56+
erubi (1.13.1)
57+
i18n (1.14.7)
5358
concurrent-ruby (~> 1.0)
54-
io-console (0.7.1)
55-
irb (1.11.0)
56-
rdoc
57-
reline (>= 0.3.8)
58-
json (2.7.1)
59-
language_server-protocol (3.17.0.3)
59+
io-console (0.8.0)
60+
irb (1.15.1)
61+
pp (>= 0.6.0)
62+
rdoc (>= 4.0.0)
63+
reline (>= 0.4.2)
64+
json (2.9.1)
65+
language_server-protocol (3.17.0.4)
6066
lint_roller (1.1.0)
61-
loofah (2.22.0)
67+
logger (1.6.5)
68+
loofah (2.24.0)
6269
crass (~> 1.0.2)
6370
nokogiri (>= 1.12.0)
64-
method_source (1.0.0)
65-
minitest (5.25.1)
66-
mutex_m (0.2.0)
67-
nokogiri (1.16.7-arm64-darwin)
71+
method_source (1.1.0)
72+
minitest (5.25.4)
73+
mutex_m (0.3.0)
74+
nokogiri (1.17.2-arm64-darwin)
6875
racc (~> 1.4)
69-
nokogiri (1.16.7-x86_64-darwin)
76+
nokogiri (1.17.2-x86_64-darwin)
7077
racc (~> 1.4)
71-
nokogiri (1.16.7-x86_64-linux)
78+
nokogiri (1.17.2-x86_64-linux)
7279
racc (~> 1.4)
73-
parallel (1.24.0)
74-
parser (3.3.0.5)
80+
parallel (1.26.3)
81+
parser (3.3.7.0)
7582
ast (~> 2.4.1)
7683
racc
77-
pry (0.14.2)
84+
pp (0.6.2)
85+
prettyprint
86+
prettyprint (0.2.0)
87+
pry (0.15.2)
7888
coderay (~> 1.1)
7989
method_source (~> 1.0)
80-
psych (5.1.2)
90+
psych (5.2.3)
91+
date
8192
stringio
8293
racc (1.8.1)
8394
rack (3.1.8)
84-
rack-session (2.0.0)
95+
rack-session (2.1.0)
96+
base64 (>= 0.1.0)
8597
rack (>= 3.0.0)
86-
rack-test (2.1.0)
98+
rack-test (2.2.0)
8799
rack (>= 1.3)
88-
rackup (2.1.0)
100+
rackup (2.2.1)
89101
rack (>= 3)
90-
webrick (~> 1.8)
91102
rails-dom-testing (2.2.0)
92103
activesupport (>= 5.0.0)
93104
minitest
94105
nokogiri (>= 1.6)
95-
rails-html-sanitizer (1.6.0)
106+
rails-html-sanitizer (1.6.2)
96107
loofah (~> 2.21)
97-
nokogiri (~> 1.14)
98-
railties (7.1.4.1)
99-
actionpack (= 7.1.4.1)
100-
activesupport (= 7.1.4.1)
108+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
109+
railties (7.1.5.1)
110+
actionpack (= 7.1.5.1)
111+
activesupport (= 7.1.5.1)
101112
irb
102113
rackup (>= 1.0.0)
103114
rake (>= 12.2)
104115
thor (~> 1.0, >= 1.2.2)
105116
zeitwerk (~> 2.6)
106117
rainbow (3.1.1)
107-
rake (13.1.0)
108-
rdoc (6.6.3.1)
118+
rake (13.2.1)
119+
rdoc (6.11.0)
109120
psych (>= 4.0.0)
110-
regexp_parser (2.9.0)
111-
reline (0.4.1)
121+
regexp_parser (2.10.0)
122+
reline (0.6.0)
112123
io-console (~> 0.5)
113-
rexml (3.3.6)
114-
strscan
115-
rspec-core (3.12.2)
116-
rspec-support (~> 3.12.0)
117-
rspec-expectations (3.12.3)
124+
rspec-core (3.13.2)
125+
rspec-support (~> 3.13.0)
126+
rspec-expectations (3.13.3)
118127
diff-lcs (>= 1.2.0, < 2.0)
119-
rspec-support (~> 3.12.0)
120-
rspec-mocks (3.12.6)
128+
rspec-support (~> 3.13.0)
129+
rspec-mocks (3.13.2)
121130
diff-lcs (>= 1.2.0, < 2.0)
122-
rspec-support (~> 3.12.0)
123-
rspec-rails (6.1.0)
124-
actionpack (>= 6.1)
125-
activesupport (>= 6.1)
126-
railties (>= 6.1)
127-
rspec-core (~> 3.12)
128-
rspec-expectations (~> 3.12)
129-
rspec-mocks (~> 3.12)
130-
rspec-support (~> 3.12)
131-
rspec-support (3.12.1)
132-
rubocop (1.62.1)
131+
rspec-support (~> 3.13.0)
132+
rspec-rails (7.1.0)
133+
actionpack (>= 7.0)
134+
activesupport (>= 7.0)
135+
railties (>= 7.0)
136+
rspec-core (~> 3.13)
137+
rspec-expectations (~> 3.13)
138+
rspec-mocks (~> 3.13)
139+
rspec-support (~> 3.13)
140+
rspec-support (3.13.2)
141+
rubocop (1.71.0)
133142
json (~> 2.3)
134143
language_server-protocol (>= 3.17.0)
135144
parallel (~> 1.10)
136145
parser (>= 3.3.0.2)
137146
rainbow (>= 2.2.2, < 4.0)
138-
regexp_parser (>= 1.8, < 3.0)
139-
rexml (>= 3.2.5, < 4.0)
140-
rubocop-ast (>= 1.31.1, < 2.0)
147+
regexp_parser (>= 2.9.3, < 3.0)
148+
rubocop-ast (>= 1.36.2, < 2.0)
141149
ruby-progressbar (~> 1.7)
142-
unicode-display_width (>= 2.4.0, < 3.0)
143-
rubocop-ast (1.31.2)
144-
parser (>= 3.3.0.4)
145-
rubocop-capybara (2.19.0)
150+
unicode-display_width (>= 2.4.0, < 4.0)
151+
rubocop-ast (1.37.0)
152+
parser (>= 3.3.1.0)
153+
rubocop-capybara (2.21.0)
146154
rubocop (~> 1.41)
147-
rubocop-factory_bot (2.24.0)
148-
rubocop (~> 1.33)
149-
rubocop-graphql (1.5.1)
150-
rubocop (>= 0.90, < 2)
151-
rubocop-performance (1.21.0)
155+
rubocop-factory_bot (2.26.1)
156+
rubocop (~> 1.61)
157+
rubocop-graphql (1.5.4)
158+
rubocop (>= 1.50, < 2)
159+
rubocop-performance (1.23.1)
152160
rubocop (>= 1.48.1, < 2.0)
153161
rubocop-ast (>= 1.31.1, < 2.0)
154-
rubocop-rails (2.24.1)
162+
rubocop-rails (2.29.1)
155163
activesupport (>= 4.2.0)
156164
rack (>= 1.1)
157-
rubocop (>= 1.33.0, < 2.0)
165+
rubocop (>= 1.52.0, < 2.0)
158166
rubocop-ast (>= 1.31.1, < 2.0)
159167
rubocop-rake (0.6.0)
160168
rubocop (~> 1.0)
161-
rubocop-rspec (2.28.0)
169+
rubocop-rspec (2.31.0)
162170
rubocop (~> 1.40)
163171
rubocop-capybara (~> 2.17)
164172
rubocop-factory_bot (~> 2.22)
165173
rubocop-rspec_rails (~> 2.28)
166-
rubocop-rspec_rails (2.28.2)
167-
rubocop (~> 1.40)
174+
rubocop-rspec_rails (2.29.1)
175+
rubocop (~> 1.61)
168176
ruby-progressbar (1.13.0)
169-
standard (1.35.1)
177+
securerandom (0.3.2)
178+
standard (1.35.0.1)
170179
language_server-protocol (~> 3.17.0.2)
171180
lint_roller (~> 1.0)
172-
rubocop (~> 1.62.0)
181+
rubocop (~> 1.62)
173182
standard-custom (~> 1.0.0)
174183
standard-performance (~> 1.3)
175184
standard-custom (1.0.2)
176185
lint_roller (~> 1.0)
177186
rubocop (~> 1.50)
178-
standard-performance (1.4.0)
187+
standard-performance (1.6.0)
179188
lint_roller (~> 1.1)
180-
rubocop-performance (~> 1.21.0)
181-
stringio (3.1.0)
182-
strscan (3.1.0)
183-
thor (1.3.0)
189+
rubocop-performance (~> 1.23.0)
190+
stringio (3.1.2)
191+
thor (1.3.2)
184192
tzinfo (2.0.6)
185193
concurrent-ruby (~> 1.0)
186-
unicode-display_width (2.5.0)
187-
webrick (1.8.2)
188-
zeitwerk (2.6.12)
194+
unicode-display_width (3.1.4)
195+
unicode-emoji (~> 4.0, >= 4.0.4)
196+
unicode-emoji (4.0.4)
197+
zeitwerk (2.6.18)
189198

190199
PLATFORMS
191200
arm64-darwin-22
@@ -194,12 +203,16 @@ PLATFORMS
194203
x86_64-linux
195204

196205
DEPENDENCIES
206+
activesupport (~> 7.1.5)
197207
betterlint!
198208
bundler
209+
nokogiri (~> 1.17.2)
199210
pry
200211
rake (>= 12.3.3)
201212
rspec-rails
213+
securerandom (~> 0.3.2)
202214
standard
215+
zeitwerk (~> 2.6.18)
203216

204217
BUNDLED WITH
205218
2.4.22

0 commit comments

Comments
 (0)