From 90da071bb63dee80b496628b33e63db0952de2b2 Mon Sep 17 00:00:00 2001 From: Hartley McGuire Date: Tue, 2 Jan 2024 06:49:36 -0500 Subject: [PATCH] bundle update rubocop --conservative (#50515) Also perform two autocorrects with `bundle exec rubocop -A`: - fixes a new case of [`Style/RedundantReturn`][1] - fixes a new case of [`Performance/StringInclude`][2] [1]: 146b1c2e3389bc70ea0b54abf7843fc1d6c8cd5f [2]: 3158bbb9f6454dce64dd0b4e2a548351d014c48f Co-authored-by: David Heinemeier Hansson --- Gemfile.lock | 13 ++++++------- actionpack/test/controller/routing_test.rb | 2 +- actionview/lib/action_view/helpers/url_helper.rb | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index daf3fcd14b..465d801309 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -445,8 +445,7 @@ GEM retriable (3.1.2) rexml (3.2.6) rouge (4.2.0) - rubocop (1.57.0) - base64 (~> 0.1.1) + rubocop (1.59.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -454,10 +453,10 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) rubocop-md (1.2.0) rubocop (>= 1.0) @@ -465,9 +464,9 @@ GEM rubocop (>= 1.39, < 2.0) rubocop-packaging (0.5.2) rubocop (>= 1.33, < 2.0) - rubocop-performance (1.16.0) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rails (2.18.0) activesupport (>= 4.2.0) rack (>= 1.1) diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index fb00f454ec..2635743c54 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1694,7 +1694,7 @@ def test_route_with_subdomain_and_constraints_must_receive_params set.draw do get "page/:name" => "pages#show", :constraints => lambda { |request| name_param = request.params[:name] - return true + true } end assert_equal({ controller: "pages", action: "show", name: "mypage" }, diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb index 3b62fb5222..29d46a7708 100644 --- a/actionview/lib/action_view/helpers/url_helper.rb +++ b/actionview/lib/action_view/helpers/url_helper.rb @@ -784,7 +784,7 @@ def link_to_remote_options?(options) end def add_method_to_attributes!(html_options, method) - if method_not_get_method?(method) && !html_options["rel"]&.match?(/nofollow/) + if method_not_get_method?(method) && !html_options["rel"]&.include?("nofollow") if html_options["rel"].blank? html_options["rel"] = "nofollow" else