Skip to content

Commit 15a4a50

Browse files
authored
Merge pull request #156 from github/dependabot/bundler/rubocop-1.62.1
Bump rubocop from 1.48.1 to 1.62.1
2 parents 80111f3 + fb7fec1 commit 15a4a50

9 files changed

+58
-56
lines changed

Gemfile.lock

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GEM
3737
i18n (1.14.1)
3838
concurrent-ruby (~> 1.0)
3939
json (2.7.1)
40+
language_server-protocol (3.17.0.3)
4041
loofah (2.22.0)
4142
crass (~> 1.0.2)
4243
nokogiri (>= 1.12.0)
@@ -52,8 +53,8 @@ GEM
5253
racc (~> 1.4)
5354
nokogiri (1.16.2-x86_64-linux)
5455
racc (~> 1.4)
55-
parallel (1.23.0)
56-
parser (3.2.2.4)
56+
parallel (1.24.0)
57+
parser (3.3.0.5)
5758
ast (~> 2.4.1)
5859
racc
5960
racc (1.7.3)
@@ -67,20 +68,21 @@ GEM
6768
nokogiri (~> 1.14)
6869
rainbow (3.1.1)
6970
rake (13.1.0)
70-
regexp_parser (2.8.3)
71+
regexp_parser (2.9.0)
7172
rexml (3.2.6)
72-
rubocop (1.48.1)
73+
rubocop (1.62.1)
7374
json (~> 2.3)
75+
language_server-protocol (>= 3.17.0)
7476
parallel (~> 1.10)
75-
parser (>= 3.2.0.0)
77+
parser (>= 3.3.0.2)
7678
rainbow (>= 2.2.2, < 4.0)
7779
regexp_parser (>= 1.8, < 3.0)
7880
rexml (>= 3.2.5, < 4.0)
79-
rubocop-ast (>= 1.26.0, < 2.0)
81+
rubocop-ast (>= 1.31.1, < 2.0)
8082
ruby-progressbar (~> 1.7)
8183
unicode-display_width (>= 2.4.0, < 3.0)
82-
rubocop-ast (1.30.0)
83-
parser (>= 3.2.1.0)
84+
rubocop-ast (1.31.2)
85+
parser (>= 3.3.0.4)
8486
rubocop-performance (1.19.1)
8587
rubocop (>= 1.7.0, < 2.0)
8688
rubocop-ast (>= 0.4.0)

test/test_avoid_object_send_with_dynamic_method.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ def my_method(foo)
1616
end
1717
RUBY
1818
assert_equal 1, offenses.size
19-
assert_equal "Avoid using Object#send with a dynamic method name.", offenses.first.message
19+
assert_equal "#{cop.name}: Avoid using Object#send with a dynamic method name.", offenses.first.message
2020
end
2121

2222
def test_offended_by_public_send_call
2323
offenses = investigate cop, <<-RUBY
2424
foo.public_send(bar)
2525
RUBY
2626
assert_equal 1, offenses.size
27-
assert_equal "Avoid using Object#public_send with a dynamic method name.", offenses.first.message
27+
assert_equal "#{cop.name}: Avoid using Object#public_send with a dynamic method name.", offenses.first.message
2828
end
2929

3030
def test_offended_by_call_to___send__
3131
offenses = investigate cop, <<-RUBY
3232
foo.__send__(bar)
3333
RUBY
3434
assert_equal 1, offenses.size
35-
assert_equal "Avoid using Object#__send__ with a dynamic method name.", offenses.first.message
35+
assert_equal "#{cop.name}: Avoid using Object#__send__ with a dynamic method name.", offenses.first.message
3636
end
3737

3838
def test_offended_by_send_calls_without_receiver
@@ -42,9 +42,9 @@ def test_offended_by_send_calls_without_receiver
4242
__send__(a_variable, "foo", "bar")
4343
RUBY
4444
assert_equal 3, offenses.size
45-
assert_equal "Avoid using Object#send with a dynamic method name.", offenses[0].message
46-
assert_equal "Avoid using Object#public_send with a dynamic method name.", offenses[1].message
47-
assert_equal "Avoid using Object#__send__ with a dynamic method name.", offenses[2].message
45+
assert_equal "#{cop.name}: Avoid using Object#send with a dynamic method name.", offenses[0].message
46+
assert_equal "#{cop.name}: Avoid using Object#public_send with a dynamic method name.", offenses[1].message
47+
assert_equal "#{cop.name}: Avoid using Object#__send__ with a dynamic method name.", offenses[2].message
4848
end
4949

5050
def test_unoffended_by_other_method_calls

test/test_insecure_hash_algorithm.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def secret_hmac
5757
RUBY
5858

5959
assert_equal 1, offenses.count
60-
assert_equal cop_class::MSG, offenses.first.message
60+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
6161
end
6262

6363
def test_digest_method_md5_str
@@ -70,7 +70,7 @@ def h
7070
RUBY
7171

7272
assert_equal 1, offenses.count
73-
assert_equal cop_class::MSG, offenses.first.message
73+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
7474
end
7575

7676
def test_digest_method_md5_symbol
@@ -83,7 +83,7 @@ def h
8383
RUBY
8484

8585
assert_equal 1, offenses.count
86-
assert_equal cop_class::MSG, offenses.first.message
86+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
8787
end
8888

8989
def test_digest_method_sha256_str
@@ -122,7 +122,7 @@ class Something
122122
RUBY
123123

124124
assert_equal 1, offenses.count
125-
assert_equal cop_class::MSG, offenses.first.message
125+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
126126
end
127127

128128
def test_alias_for_openssl_digest_md5
@@ -133,7 +133,7 @@ class Something
133133
RUBY
134134

135135
assert_equal 1, offenses.count
136-
assert_equal cop_class::MSG, offenses.first.message
136+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
137137
end
138138

139139
def test_alias_for_digest_sha1
@@ -144,7 +144,7 @@ class Something
144144
RUBY
145145

146146
assert_equal 1, offenses.count
147-
assert_equal cop_class::MSG, offenses.first.message
147+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
148148
end
149149

150150
def test_alias_for_openssl_digest_sha1
@@ -155,7 +155,7 @@ class Something
155155
RUBY
156156

157157
assert_equal 1, offenses.count
158-
assert_equal cop_class::MSG, offenses.first.message
158+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
159159
end
160160

161161
def test_alias_for_digest_sha256
@@ -200,7 +200,7 @@ def something(str)
200200
RUBY
201201

202202
assert_equal 1, offenses.count
203-
assert_equal cop_class::MSG, offenses.first.message
203+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
204204
end
205205

206206
def test_openssl_md5_hexdigest
@@ -213,7 +213,7 @@ def something(str)
213213
RUBY
214214

215215
assert_equal 1, offenses.count
216-
assert_equal cop_class::MSG, offenses.first.message
216+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
217217
end
218218

219219
def test_openssl_md5_digest_by_name
@@ -226,7 +226,7 @@ def something(str)
226226
RUBY
227227

228228
assert_equal 1, offenses.count
229-
assert_equal cop_class::MSG, offenses.first.message
229+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
230230
end
231231

232232
def test_openssl_sha1_digest_by_name
@@ -239,7 +239,7 @@ def something(str)
239239
RUBY
240240

241241
assert_equal 1, offenses.count
242-
assert_equal cop_class::MSG, offenses.first.message
242+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
243243
end
244244

245245
def test_openssl_sha1_hexdigest_by_name_mixed_case
@@ -252,7 +252,7 @@ def something(str)
252252
RUBY
253253

254254
assert_equal 1, offenses.count
255-
assert_equal cop_class::MSG, offenses.first.message
255+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
256256
end
257257

258258
def test_openssl_sha256_digest_by_name
@@ -277,7 +277,7 @@ def something(str)
277277
RUBY
278278

279279
assert_equal 1, offenses.count
280-
assert_equal cop_class::MSG, offenses.first.message
280+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
281281
end
282282

283283
def test_openssl_sha1_hmac_by_name
@@ -290,7 +290,7 @@ def something(str)
290290
RUBY
291291

292292
assert_equal 1, offenses.count
293-
assert_equal cop_class::MSG, offenses.first.message
293+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
294294
end
295295

296296
def test_openssl_sha256_hmac_by_name
@@ -315,7 +315,7 @@ def something(str)
315315
RUBY
316316

317317
assert_equal 1, offenses.count
318-
assert_equal cop_class::MSG, offenses.first.message
318+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
319319
end
320320

321321
def test_openssl_sha1_digest_instance_by_name
@@ -328,7 +328,7 @@ def something(str)
328328
RUBY
329329

330330
assert_equal 1, offenses.count
331-
assert_equal cop_class::MSG, offenses.first.message
331+
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
332332
end
333333

334334
def test_openssl_sha256_digest_instance_by_name
@@ -367,7 +367,7 @@ def uuid
367367
RUBY
368368

369369
assert_equal 1, offenses.count
370-
assert_equal cop_class::UUID_V3_MSG, offenses.first.message
370+
assert_equal "#{cop.name}: #{cop_class::UUID_V3_MSG}", offenses.first.message
371371
end
372372

373373
def test_uuid_v3_with_md5_allowed
@@ -405,7 +405,7 @@ def uuid
405405
RUBY
406406

407407
assert_equal 1, offenses.count
408-
assert_equal cop_class::UUID_V5_MSG, offenses.first.message
408+
assert_equal "#{cop.name}: #{cop_class::UUID_V5_MSG}", offenses.first.message
409409
end
410410

411411
def test_uuid_v5_with_sha1_allowed

test/test_rails_controller_render_action_symbol.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def update
4747
RUBY
4848

4949
assert_equal 3, offenses.count
50-
expected_message = "Prefer `render` with string instead of symbol"
50+
expected_message = "#{cop.name}: Prefer `render` with string instead of symbol"
5151
assert_equal expected_message, offenses[0].message
5252
assert_equal expected_message, offenses[1].message
5353
assert_equal expected_message, offenses[2].message

test/test_rails_controller_render_literal.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def index
274274
RUBY
275275

276276
assert_equal 1, offenses.count
277-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
277+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
278278
end
279279

280280
def test_render_implicit_with_layout_offense
@@ -287,7 +287,7 @@ def index
287287
RUBY
288288

289289
assert_equal 1, offenses.count
290-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
290+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
291291
end
292292

293293
def test_render_implicit_with_status_offense
@@ -300,7 +300,7 @@ def index
300300
RUBY
301301

302302
assert_equal 1, offenses.count
303-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
303+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
304304
end
305305

306306
def test_render_variable_offense
@@ -313,7 +313,7 @@ def index
313313
RUBY
314314

315315
assert_equal 1, offenses.count
316-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
316+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
317317
end
318318

319319
def test_render_to_string_variable_offense
@@ -326,7 +326,7 @@ def index
326326
RUBY
327327

328328
assert_equal 1, offenses.count
329-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
329+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
330330
end
331331

332332
def test_render_action_variable_offense
@@ -339,7 +339,7 @@ def index
339339
RUBY
340340

341341
assert_equal 1, offenses.count
342-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
342+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
343343
end
344344

345345
def test_render_template_variable_offense
@@ -352,7 +352,7 @@ def index
352352
RUBY
353353

354354
assert_equal 1, offenses.count
355-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
355+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
356356
end
357357

358358
def test_render_partial_variable_offense
@@ -365,7 +365,7 @@ def index
365365
RUBY
366366

367367
assert_equal 1, offenses.count
368-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
368+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
369369
end
370370

371371
def test_render_template_with_layout_variable_offense
@@ -378,7 +378,7 @@ def index
378378
RUBY
379379

380380
assert_equal 1, offenses.count
381-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
381+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
382382
end
383383

384384
def test_render_template_variable_with_layout_offense
@@ -391,7 +391,7 @@ def index
391391
RUBY
392392

393393
assert_equal 1, offenses.count
394-
assert_equal "render must be used with a string literal or an instance of a Class", offenses[0].message
394+
assert_equal "#{cop.name}: render must be used with a string literal or an instance of a Class", offenses[0].message
395395
end
396396

397397
def test_render_shorthand_static_locals_no_offsense

test/test_rails_controller_render_shorthand.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def confirm
5555
RUBY
5656

5757
assert_equal 3, offenses.count
58-
assert_equal "Use `render \"edit\"` instead", offenses[0].message
59-
assert_equal "Use `render \"new\"` instead", offenses[1].message
60-
assert_equal "Use `render \"confirm.html.erb\"` instead", offenses[2].message
58+
assert_equal "#{cop.name}: Use `render \"edit\"` instead", offenses[0].message
59+
assert_equal "#{cop.name}: Use `render \"new\"` instead", offenses[1].message
60+
assert_equal "#{cop.name}: Use `render \"confirm.html.erb\"` instead", offenses[2].message
6161
end
6262

6363
def test_render_template_offense
@@ -78,8 +78,8 @@ def edit
7878
RUBY
7979

8080
assert_equal 3, offenses.count
81-
assert_equal "Use `render \"books/new\"` instead", offenses[0].message
82-
assert_equal "Use `render \"books/show\", locals: { book: @book }` instead", offenses[1].message
83-
assert_equal "Use `render \"books/edit.html.erb\", status: :ok, layout: \"application\"` instead", offenses[2].message
81+
assert_equal "#{cop.name}: Use `render \"books/new\"` instead", offenses[0].message
82+
assert_equal "#{cop.name}: Use `render \"books/show\", locals: { book: @book }` instead", offenses[1].message
83+
assert_equal "#{cop.name}: Use `render \"books/edit.html.erb\", status: :ok, layout: \"application\"` instead", offenses[2].message
8484
end
8585
end

test/test_rails_render_object_collection.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_render_partial_with_object_offense
2727
ERB
2828

2929
assert_equal 1, offenses.count
30-
assert_equal "Avoid `render object:`, instead `render partial: \"account\", locals: { account: @buyer }`", offenses[0].message
30+
assert_equal "#{cop.name}: Avoid `render object:`, instead `render partial: \"account\", locals: { account: @buyer }`", offenses[0].message
3131
end
3232

3333
def test_render_collection_with_object_offense
@@ -36,7 +36,7 @@ def test_render_collection_with_object_offense
3636
ERB
3737

3838
assert_equal 1, offenses.count
39-
assert_equal "Avoid `render collection:`", offenses[0].message
39+
assert_equal "#{cop.name}: Avoid `render collection:`", offenses[0].message
4040
end
4141

4242
def test_render_spacer_template_with_object_offense
@@ -45,6 +45,6 @@ def test_render_spacer_template_with_object_offense
4545
ERB
4646

4747
assert_equal 1, offenses.count
48-
assert_equal "Avoid `render collection:`", offenses[0].message
48+
assert_equal "#{cop.name}: Avoid `render collection:`", offenses[0].message
4949
end
5050
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy