Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rubocop from 1.48.1 to 1.62.1 #156

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.7.1)
language_server-protocol (3.17.0.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -52,8 +53,8 @@ GEM
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.4)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
racc (1.7.3)
Expand All @@ -67,20 +68,21 @@ GEM
nokogiri (~> 1.14)
rainbow (3.1.1)
rake (13.1.0)
regexp_parser (2.8.3)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.48.1)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.26.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
Expand Down
12 changes: 6 additions & 6 deletions test/test_avoid_object_send_with_dynamic_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ def my_method(foo)
end
RUBY
assert_equal 1, offenses.size
assert_equal "Avoid using Object#send with a dynamic method name.", offenses.first.message
assert_equal "#{cop.name}: Avoid using Object#send with a dynamic method name.", offenses.first.message
end

def test_offended_by_public_send_call
offenses = investigate cop, <<-RUBY
foo.public_send(bar)
RUBY
assert_equal 1, offenses.size
assert_equal "Avoid using Object#public_send with a dynamic method name.", offenses.first.message
assert_equal "#{cop.name}: Avoid using Object#public_send with a dynamic method name.", offenses.first.message
end

def test_offended_by_call_to___send__
offenses = investigate cop, <<-RUBY
foo.__send__(bar)
RUBY
assert_equal 1, offenses.size
assert_equal "Avoid using Object#__send__ with a dynamic method name.", offenses.first.message
assert_equal "#{cop.name}: Avoid using Object#__send__ with a dynamic method name.", offenses.first.message
end

def test_offended_by_send_calls_without_receiver
Expand All @@ -42,9 +42,9 @@ def test_offended_by_send_calls_without_receiver
__send__(a_variable, "foo", "bar")
RUBY
assert_equal 3, offenses.size
assert_equal "Avoid using Object#send with a dynamic method name.", offenses[0].message
assert_equal "Avoid using Object#public_send with a dynamic method name.", offenses[1].message
assert_equal "Avoid using Object#__send__ with a dynamic method name.", offenses[2].message
assert_equal "#{cop.name}: Avoid using Object#send with a dynamic method name.", offenses[0].message
assert_equal "#{cop.name}: Avoid using Object#public_send with a dynamic method name.", offenses[1].message
assert_equal "#{cop.name}: Avoid using Object#__send__ with a dynamic method name.", offenses[2].message
end

def test_unoffended_by_other_method_calls
Expand Down
36 changes: 18 additions & 18 deletions test/test_insecure_hash_algorithm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def secret_hmac
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_digest_method_md5_str
Expand All @@ -70,7 +70,7 @@ def h
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_digest_method_md5_symbol
Expand All @@ -83,7 +83,7 @@ def h
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_digest_method_sha256_str
Expand Down Expand Up @@ -122,7 +122,7 @@ class Something
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_alias_for_openssl_digest_md5
Expand All @@ -133,7 +133,7 @@ class Something
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_alias_for_digest_sha1
Expand All @@ -144,7 +144,7 @@ class Something
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_alias_for_openssl_digest_sha1
Expand All @@ -155,7 +155,7 @@ class Something
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_alias_for_digest_sha256
Expand Down Expand Up @@ -200,7 +200,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_md5_hexdigest
Expand All @@ -213,7 +213,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_md5_digest_by_name
Expand All @@ -226,7 +226,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha1_digest_by_name
Expand All @@ -239,7 +239,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha1_hexdigest_by_name_mixed_case
Expand All @@ -252,7 +252,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha256_digest_by_name
Expand All @@ -277,7 +277,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha1_hmac_by_name
Expand All @@ -290,7 +290,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha256_hmac_by_name
Expand All @@ -315,7 +315,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha1_digest_instance_by_name
Expand All @@ -328,7 +328,7 @@ def something(str)
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::MSG}", offenses.first.message
end

def test_openssl_sha256_digest_instance_by_name
Expand Down Expand Up @@ -367,7 +367,7 @@ def uuid
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::UUID_V3_MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::UUID_V3_MSG}", offenses.first.message
end

def test_uuid_v3_with_md5_allowed
Expand Down Expand Up @@ -405,7 +405,7 @@ def uuid
RUBY

assert_equal 1, offenses.count
assert_equal cop_class::UUID_V5_MSG, offenses.first.message
assert_equal "#{cop.name}: #{cop_class::UUID_V5_MSG}", offenses.first.message
end

def test_uuid_v5_with_sha1_allowed
Expand Down
2 changes: 1 addition & 1 deletion test/test_rails_controller_render_action_symbol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def update
RUBY

assert_equal 3, offenses.count
expected_message = "Prefer `render` with string instead of symbol"
expected_message = "#{cop.name}: Prefer `render` with string instead of symbol"
assert_equal expected_message, offenses[0].message
assert_equal expected_message, offenses[1].message
assert_equal expected_message, offenses[2].message
Expand Down
20 changes: 10 additions & 10 deletions test/test_rails_controller_render_literal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def index
RUBY

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

def test_render_implicit_with_layout_offense
Expand All @@ -287,7 +287,7 @@ def index
RUBY

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

def test_render_implicit_with_status_offense
Expand All @@ -300,7 +300,7 @@ def index
RUBY

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

def test_render_variable_offense
Expand All @@ -313,7 +313,7 @@ def index
RUBY

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

def test_render_to_string_variable_offense
Expand All @@ -326,7 +326,7 @@ def index
RUBY

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

def test_render_action_variable_offense
Expand All @@ -339,7 +339,7 @@ def index
RUBY

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

def test_render_template_variable_offense
Expand All @@ -352,7 +352,7 @@ def index
RUBY

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

def test_render_partial_variable_offense
Expand All @@ -365,7 +365,7 @@ def index
RUBY

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

def test_render_template_with_layout_variable_offense
Expand All @@ -378,7 +378,7 @@ def index
RUBY

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

def test_render_template_variable_with_layout_offense
Expand All @@ -391,7 +391,7 @@ def index
RUBY

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

def test_render_shorthand_static_locals_no_offsense
Expand Down
12 changes: 6 additions & 6 deletions test/test_rails_controller_render_shorthand.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def confirm
RUBY

assert_equal 3, offenses.count
assert_equal "Use `render \"edit\"` instead", offenses[0].message
assert_equal "Use `render \"new\"` instead", offenses[1].message
assert_equal "Use `render \"confirm.html.erb\"` instead", offenses[2].message
assert_equal "#{cop.name}: Use `render \"edit\"` instead", offenses[0].message
assert_equal "#{cop.name}: Use `render \"new\"` instead", offenses[1].message
assert_equal "#{cop.name}: Use `render \"confirm.html.erb\"` instead", offenses[2].message
end

def test_render_template_offense
Expand All @@ -78,8 +78,8 @@ def edit
RUBY

assert_equal 3, offenses.count
assert_equal "Use `render \"books/new\"` instead", offenses[0].message
assert_equal "Use `render \"books/show\", locals: { book: @book }` instead", offenses[1].message
assert_equal "Use `render \"books/edit.html.erb\", status: :ok, layout: \"application\"` instead", offenses[2].message
assert_equal "#{cop.name}: Use `render \"books/new\"` instead", offenses[0].message
assert_equal "#{cop.name}: Use `render \"books/show\", locals: { book: @book }` instead", offenses[1].message
assert_equal "#{cop.name}: Use `render \"books/edit.html.erb\", status: :ok, layout: \"application\"` instead", offenses[2].message
end
end
6 changes: 3 additions & 3 deletions test/test_rails_render_object_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_render_partial_with_object_offense
ERB

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

def test_render_collection_with_object_offense
Expand All @@ -36,7 +36,7 @@ def test_render_collection_with_object_offense
ERB

assert_equal 1, offenses.count
assert_equal "Avoid `render collection:`", offenses[0].message
assert_equal "#{cop.name}: Avoid `render collection:`", offenses[0].message
end

def test_render_spacer_template_with_object_offense
Expand All @@ -45,6 +45,6 @@ def test_render_spacer_template_with_object_offense
ERB

assert_equal 1, offenses.count
assert_equal "Avoid `render collection:`", offenses[0].message
assert_equal "#{cop.name}: Avoid `render collection:`", offenses[0].message
end
end
Loading