diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cae97817d..5f0eaac8e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `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 # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/Gemfile.lock b/Gemfile.lock index 95519462f..5f8c685a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -761,7 +761,7 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 9) rspec-support (3.13.3) - rubocop (1.76.1) + rubocop (1.76.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -769,7 +769,7 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.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) unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.45.1) diff --git a/app/lib/emoji_formatter.rb b/app/lib/emoji_formatter.rb index a31353616..c193df9bb 100644 --- a/app/lib/emoji_formatter.rb +++ b/app/lib/emoji_formatter.rb @@ -46,12 +46,12 @@ class EmojiFormatter if inside_shortname && text[i] == ':' inside_shortname = false - shortcode = text[shortname_start_index + 1..i - 1] + shortcode = text[(shortname_start_index + 1)..(i - 1)] char_after = text[i + 1] 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)) last_index = i + 1 diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index a7620fb74..45fb06e70 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -58,7 +58,7 @@ class TextFormatter prefix = url.match(URL_PREFIX_REGEX).to_s display_url = url[prefix.length, 30] - suffix = url[prefix.length + 30..] + suffix = url[(prefix.length + 30)..] cutoff = url[prefix.length..].length > 30 if suffix && suffix.length == 1 # revert truncation to account for ellipsis