Update rubocop to version 1.76.2 (#35070)

This commit is contained in:
Matt Jankowski 2025-06-18 05:54:17 -04:00 committed by GitHub
parent adf01b021c
commit b1fe35d7d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp` # `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.76.1. # using RuboCop version 1.76.2.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new

View File

@ -761,7 +761,7 @@ GEM
rspec-mocks (~> 3.0) rspec-mocks (~> 3.0)
sidekiq (>= 5, < 9) sidekiq (>= 5, < 9)
rspec-support (3.13.3) rspec-support (3.13.3)
rubocop (1.76.1) rubocop (1.76.2)
json (~> 2.3) json (~> 2.3)
language_server-protocol (~> 3.17.0.2) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0) lint_roller (~> 1.1.0)
@ -769,7 +769,7 @@ GEM
parser (>= 3.3.0.2) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0) rubocop-ast (>= 1.45.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.1) rubocop-ast (1.45.1)

View File

@ -46,12 +46,12 @@ class EmojiFormatter
if inside_shortname && text[i] == ':' if inside_shortname && text[i] == ':'
inside_shortname = false inside_shortname = false
shortcode = text[shortname_start_index + 1..i - 1] shortcode = text[(shortname_start_index + 1)..(i - 1)]
char_after = text[i + 1] char_after = text[i + 1]
next unless (char_after.nil? || !DISALLOWED_BOUNDING_REGEX.match?(char_after)) && (emoji = emoji_map[shortcode]) next unless (char_after.nil? || !DISALLOWED_BOUNDING_REGEX.match?(char_after)) && (emoji = emoji_map[shortcode])
result << tree.document.create_text_node(text[last_index..shortname_start_index - 1]) if shortname_start_index.positive? result << tree.document.create_text_node(text[last_index..(shortname_start_index - 1)]) if shortname_start_index.positive?
result << tree.document.fragment(tag_for_emoji(shortcode, emoji)) result << tree.document.fragment(tag_for_emoji(shortcode, emoji))
last_index = i + 1 last_index = i + 1

View File

@ -58,7 +58,7 @@ class TextFormatter
prefix = url.match(URL_PREFIX_REGEX).to_s prefix = url.match(URL_PREFIX_REGEX).to_s
display_url = url[prefix.length, 30] display_url = url[prefix.length, 30]
suffix = url[prefix.length + 30..] suffix = url[(prefix.length + 30)..]
cutoff = url[prefix.length..].length > 30 cutoff = url[prefix.length..].length > 30
if suffix && suffix.length == 1 # revert truncation to account for ellipsis if suffix && suffix.length == 1 # revert truncation to account for ellipsis