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]: 146b1c2e33
[2]: 3158bbb9f6

Co-authored-by: David Heinemeier Hansson <david@basecamp.com>
This commit is contained in:
Hartley McGuire 2024-01-02 06:49:36 -05:00 committed by GitHub
parent 66615ac514
commit 90da071bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View File

@ -445,8 +445,7 @@ GEM
retriable (3.1.2) retriable (3.1.2)
rexml (3.2.6) rexml (3.2.6)
rouge (4.2.0) rouge (4.2.0)
rubocop (1.57.0) rubocop (1.59.0)
base64 (~> 0.1.1)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (>= 3.17.0)
parallel (~> 1.10) parallel (~> 1.10)
@ -454,10 +453,10 @@ GEM
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.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) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0) rubocop-ast (1.30.0)
parser (>= 3.2.1.0) parser (>= 3.2.1.0)
rubocop-md (1.2.0) rubocop-md (1.2.0)
rubocop (>= 1.0) rubocop (>= 1.0)
@ -465,9 +464,9 @@ GEM
rubocop (>= 1.39, < 2.0) rubocop (>= 1.39, < 2.0)
rubocop-packaging (0.5.2) rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0) rubocop (>= 1.33, < 2.0)
rubocop-performance (1.16.0) rubocop-performance (1.20.1)
rubocop (>= 1.7.0, < 2.0) rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 0.4.0) rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.18.0) rubocop-rails (2.18.0)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
rack (>= 1.1) rack (>= 1.1)

View File

@ -1694,7 +1694,7 @@ class RouteSetTest < ActiveSupport::TestCase
set.draw do set.draw do
get "page/:name" => "pages#show", :constraints => lambda { |request| get "page/:name" => "pages#show", :constraints => lambda { |request|
name_param = request.params[:name] name_param = request.params[:name]
return true true
} }
end end
assert_equal({ controller: "pages", action: "show", name: "mypage" }, assert_equal({ controller: "pages", action: "show", name: "mypage" },

View File

@ -784,7 +784,7 @@ module ActionView
end end
def add_method_to_attributes!(html_options, method) 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? if html_options["rel"].blank?
html_options["rel"] = "nofollow" html_options["rel"] = "nofollow"
else else