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.69.2 to 1.71.0 #713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 23, 2025

Bumps rubocop from 1.69.2 to 1.71.0.

Release notes

Sourced from rubocop's releases.

RuboCop 1.70

New features

  • #13474: Add new Style/ItAssignment cop to detect local assignments to it inside blocks. ([@​dvandersluis][])
  • #11013: Add new Lint/SharedMutableDefault cop to alert on mutable Hash defaults. ([@​corsonknowles][])
  • #13612: Create new cop Lint/ConstantReassignment. ([@​lovro-bikic][])
  • #13628: Make LSP server support quick fix code action. ([@​koic][])
  • #13607: Support passing the target ruby version through an environment variable. ([@​elliottt][])
  • #13628: Add support for Ruby LSP as a built-in add-on. ([@​koic][])
  • #13284: Add new target_gem_version API to change behavior of a cop at runtime depending on which gem version is present. ([@​earlopain][])

Bug fixes

  • #13589: Fix Lint/NonAtomicFileOperation to detect offenses with fully qualified constants. ([@​viralpraxis][])
  • #13630: Fix CLI --format option to accept fully qualified formatter class names. ([@​viralpraxis][])
  • #13624: Don't show warnings from Lint/Syntax when a syntax error occurs. ([@​earlopain][])
  • #13605: Fix RuboCop::Cop::Util.to_string_literal to work correctly with frozen strings. ([@​viralpraxis][])
  • #12393: Fix false negatives for Lint/Void inside of non-modifier conditionals. ([@​GabeIsman][])
  • #13623: Fix false negatives for Style/MultipleComparison when setting AllowMethodComparison: false and comparing with simple method calls. ([@​koic][])
  • #13644: Fix a false positive for Layout/EmptyLinesAroundAccessModifier when an access modifier and an expression are on the same line. ([@​koic][])
  • #13645: Fix a false positive for Style/MethodCallWithArgsParentheses when setting EnforcedStyle: omit_parentheses and last argument is an endless range. ([@​earlopain][])
  • #13614: Fix false positives for Style/RaiseArgs with anonymous splat and triple dot forwarding. ([@​earlopain][])
  • #13591: Fix false positives for Lint/NestedMethodDefinition when defining a method on a constant or a method call. ([@​koic][])
  • #13594: Fix false positives for Style/MultipleComparison when using multiple safe navigation method calls. ([@​koic][])
  • #13654: Fix false positives for Style/RedundantInitialize when empty initialize method has arguments. ([@​marocchino][])
  • #13608: Fix crash when running rubocop -d on a config with a remote inherit_from that causes a duplicate setting warning. ([@​dvandersluis][])
  • #12430: Fix false negatives in Style/RedundantLineContinuation with multiple line continuations. ([@​dvandersluis][])
  • #13638: Fix false positive for Naming/BlockForwarding when method just returns the block argument. ([@​mvz][])
  • #13599: Fix incorrect autocorrect for Layout/HashAlignment when there is a multiline positional argument and Layout/ArgumentAlignment is configured with EnforcedStyle: with_fixed_indentation. ([@​dvandersluis][])
  • #13586: Fix regression in Layout/SpaceAroundOperators when different comparison operators were aligned with each other. ([@​dvandersluis][])
  • #13603: Fix Lint/LiteralInInterpolation cop error on invalid string literal. ([@​viralpraxis][])
  • #13582: Fix Lint/NonAtomicFileOperation cop error on non-constant receiver. ([@​viralpraxis][])
  • #13598: Fix Lint/Void cop error on if without body. ([@​viralpraxis][])
  • #13634: Fix Style/ClassAndModuleChildren cop error on compact enforced style and unindented body. ([@​viralpraxis][])
  • #13642: Fix Style/FloatDivision cop error if #to_f has implicit receiver. ([@​viralpraxis][])
  • #13517: Fixes Style/HashExcept to recognize safe navigation when ActiveSupportExtensionsEnabled config is enabled. ([@​lovro-bikic][])
  • #13585: Fix Style/HashSyntax cop error on implicit call method. ([@​viralpraxis][])
  • #13632: Fix Style/MissingElse cop error if Style/EmptyElse's EnforcedStyle is not both and if expression contains elsif. ([@​viralpraxis][])
  • #13659: Fix Style/MissingElse cop error if Style/EmptyElse's EnforcedStyle is not both and if expression contains multiple elsif. ([@​viralpraxis][])
  • #13596: Fix Style/RedundantCondition cop error on parentheses and modifier if in else. ([@​viralpraxis][])
  • #13616: Fix incorrect autocorrect for Style/RedundantRegexpArgument when the regex contains a single quote. ([@​mrzasa][])
  • #13619: Fix Style/YodaExpression cop error in case of suffix form of operator. ([@​viralpraxis][])
  • #13578: Update Layout/LineContinuationSpacing to ignore continuations inside a regexp or xstr. ([@​dvandersluis][])
  • #13601: Update Style/SuperArguments to handle super with a block or with a chained method with a block. ([@​dvandersluis][])
  • #13568: Fix NoMethodError in ConfigValidator when a Cop's config is not a Hash and raise ValidationError instead. ([@​amomchilov][])

Changes

... (truncated)

Changelog

Sourced from rubocop's changelog.

1.71.0 (2025-01-22)

New features

Bug fixes

  • #13684: Fix a false positive for Style/FrozenStringLiteralComment when using the frozen string literal magic comment in Active Admin's arb files. ([@​koic][])
  • #13372: Add rubocop_cache to the path given by --cache-root when pruning cache. ([@​capncavedan][])
  • #13257: Fix department disable/enable comments enabling the cop for the whole file even if that file is excluded by the cop. ([@​earlopain][])
  • #13704: Fix false positives for Lint/OutOfRangeRegexpRef when matching with match using safe navigation. ([@​koic][])
  • #13720: Fix false positives for Style/BlockDelimiters when using brace blocks as conditions under EnforcedStyle: semantic. ([@​koic][])
  • #13688: Fix false negative on Style/RedundantLineContinuation when the continuation is preceded by an interpolated string. ([@​dvandersluis][])
  • #13677: Fix false negative on Style/RedundantLineContinuation when the continuation is followed by a percent array. ([@​dvandersluis][])
  • #13692: Fix false positive in Style/RedundantLineContinuation when the ruby code ends with a commented continuation. ([@​dvandersluis][])
  • #13675: Fix invalid autocorrect for Style/ArrayFirstLast when calling .[] or &.[] with 0 or -1. ([@​dvandersluis][])
  • #13685: Fix syntax error introduced by Lint/SafeNavigationChain when adding safe navigation to an operator call inside a hash. ([@​dvandersluis][])
  • #13725: Fix an incorrect autocorrect for Style/IfUnlessModifier when using omitted hash values in an assignment. ([@​elliottt][])
  • #13667: Maintain precedence in autocorrect for Style/SoleNestedConditional. ([@​tejasbubane][])
  • #13679: Fix false positive for Style/RedundantLineContinuation when calling methods with fully qualified constants. ([@​earlopain][])
  • #13728: Fix a RuboCop error on provided glob pattern which matches directory. ([@​viralpraxis][])
  • #13693: Fix Style/ConditionalAssignment cop error on unless without else and assign_inside_condition enforced style. ([@​viralpraxis][])
  • #13669: Fix Style/FrozenStringLiteralComment cop error on unnormalized magic comment and never enforced style. ([@​viralpraxis][])
  • #13696: Update Metrics/CollectionLiteralLength to only register for [] when called on Set. ([@​dvandersluis][])

Changes

1.70.0 (2025-01-10)

New features

... (truncated)

Commits
  • 6b13abb Cut 1.71
  • c923a84 Update Changelog
  • 83958cb Rename c_send to csend for consistency
  • 1f25c2c Add new InternalAffairs/OnSendWithoutOnCSend cop
  • 95f45cc [Fix #13323] Add new Lint/ArrayLiteralInRegexp cop
  • 30c4e20 Update Lint/LiteralInInterpolation to not handle array literals inside a re...
  • 7edf6d7 [Doc] Move rubocop-i18n from puppetlabs to rubocop org
  • c746991 Merge pull request #13737 from dvandersluis/fix-jruby-ci
  • b3c8061 Fix jruby CI error
  • 617fd40 Merge pull request #13734 from dvandersluis/fix-expect-offense
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.69.2 to 1.71.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.69.2...v1.71.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies ruby Pull requests that update Ruby code labels Jan 23, 2025
Copy link

gem compare parser 3.3.6.0 3.3.7.0

Compared versions: ["3.3.6.0", "3.3.7.0"]
  DIFFERENT date:
    3.3.6.0: 2024-11-05 00:00:00 UTC
    3.3.7.0: 2025-01-16 00:00:00 UTC
  DIFFERENT metadata:
    3.3.6.0: {"bug_tracker_uri" => "https://github.com/whitequark/parser/issues", "changelog_uri" => "https://github.com/whitequark/parser/blob/v3.3.6.0/CHANGELOG.md", "documentation_uri" => "https://www.rubydoc.info/gems/parser/3.3.6.0", "source_code_uri" => "https://github.com/whitequark/parser/tree/v3.3.6.0"}
    3.3.7.0: {"bug_tracker_uri" => "https://github.com/whitequark/parser/issues", "changelog_uri" => "https://github.com/whitequark/parser/blob/v3.3.7.0/CHANGELOG.md", "documentation_uri" => "https://www.rubydoc.info/gems/parser/3.3.7.0", "source_code_uri" => "https://github.com/whitequark/parser/tree/v3.3.7.0"}
  DIFFERENT version:
    3.3.6.0: 3.3.6.0
    3.3.7.0: 3.3.7.0
  DIFFERENT files:
    3.3.6.0->3.3.7.0:
      * Changed:
            lib/parser/context.rb +2/-0
            lib/parser/current.rb +1/-1
            lib/parser/ruby34.rb +8/-1
            lib/parser/runner.rb +6/-1
            lib/parser/version.rb +1/-1

Copy link

gem compare --diff parser 3.3.6.0 3.3.7.0

Compared versions: ["3.3.6.0", "3.3.7.0"]
  DIFFERENT files:
    3.3.6.0->3.3.7.0:
      * Changed:
        lib/parser/context.rb
                --- /tmp/d20250123-2254-vwvha9/parser-3.3.6.0/lib/parser/context.rb	2025-01-23 03:24:11.706917323 +0000
                +++ /tmp/d20250123-2254-vwvha9/parser-3.3.7.0/lib/parser/context.rb	2025-01-23 03:24:11.991918304 +0000
                @@ -26,0 +27 @@
                +      cant_return
                @@ -40,0 +42 @@
                +      @cant_return = false
        lib/parser/current.rb
                --- /tmp/d20250123-2254-vwvha9/parser-3.3.6.0/lib/parser/current.rb	2025-01-23 03:24:11.706917323 +0000
                +++ /tmp/d20250123-2254-vwvha9/parser-3.3.7.0/lib/parser/current.rb	2025-01-23 03:24:11.991918304 +0000
                @@ -114 +114 @@
                -    current_version = '3.3.6'
                +    current_version = '3.3.7'
        lib/parser/ruby34.rb
                --- /tmp/d20250123-2254-vwvha9/parser-3.3.6.0/lib/parser/ruby34.rb	2025-01-23 03:24:11.982918273 +0000
                +++ /tmp/d20250123-2254-vwvha9/parser-3.3.7.0/lib/parser/ruby34.rb	2025-01-23 03:24:12.022918410 +0000
                @@ -8790,0 +8791 @@
                +                      @context.cant_return = false
                @@ -10211,0 +10213 @@
                +                      @context.cant_return = true
                @@ -10228,0 +10231 @@
                +                      @context.cant_return = ctx.cant_return
                @@ -10235,0 +10239 @@
                +                      @context.cant_return = true
                @@ -10248,0 +10253 @@
                +                      @context.cant_return = ctx.cant_return
                @@ -10254,0 +10260 @@
                +                      @context.cant_return = true
                @@ -10269,0 +10276 @@
                +                      @context.cant_return = ctx.cant_return
                @@ -10344 +10351 @@
                -                      if @context.in_class && !@context.in_def && !(context.in_block || context.in_lambda)
                +                      if @context.cant_return && !(context.in_block || context.in_lambda)
        lib/parser/runner.rb
                --- /tmp/d20250123-2254-vwvha9/parser-3.3.6.0/lib/parser/runner.rb	2025-01-23 03:24:11.983918276 +0000
                +++ /tmp/d20250123-2254-vwvha9/parser-3.3.7.0/lib/parser/runner.rb	2025-01-23 03:24:12.024918417 +0000
                @@ -245 +245,6 @@
                -        source = File.read(filename).force_encoding(@parser.default_encoding)
                +        source = begin
                +          File.read(filename).force_encoding(@parser.default_encoding)
                +        rescue Errno::EISDIR
                +          # Will happen for a folder called `foo.rb`. Just catch this here, it's cheaper than checking every file.
                +          next
                +        end
        lib/parser/version.rb
                --- /tmp/d20250123-2254-vwvha9/parser-3.3.6.0/lib/parser/version.rb	2025-01-23 03:24:11.988918293 +0000
                +++ /tmp/d20250123-2254-vwvha9/parser-3.3.7.0/lib/parser/version.rb	2025-01-23 03:24:12.028918431 +0000
                @@ -4 +4 @@
                -  VERSION = '3.3.6.0'
                +  VERSION = '3.3.7.0'

Copy link

gem compare regexp_parser 2.9.3 2.10.0

Compared versions: ["2.9.3", "2.10.0"]
  DIFFERENT date:
    2.9.3: 2024-11-29 00:00:00 UTC
    2.10.0: 2024-12-25 00:00:00 UTC
  DIFFERENT version:
    2.9.3: 2.9.3
    2.10.0: 2.10.0
  DIFFERENT files:
    2.9.3->2.10.0:
      * Added:
            lib/regexp_parser/expression/methods/escape_sequence_char.rb +5/-0
            lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb +68/-0
            lib/regexp_parser/expression/methods/referenced_expressions.rb +28/-0
      * Changed:
            lib/regexp_parser/expression.rb +3/-0
            lib/regexp_parser/expression/classes/backreference.rb +1/-20
            lib/regexp_parser/expression/classes/conditional.rb +0/-14
            lib/regexp_parser/expression/classes/escape_sequence.rb +22/-94
            lib/regexp_parser/parser.rb +8/-5
            lib/regexp_parser/version.rb +1/-1

Copy link

gem compare --diff regexp_parser 2.9.3 2.10.0

Compared versions: ["2.9.3", "2.10.0"]
  DIFFERENT files:
    2.9.3->2.10.0:
      * Added:
        lib/regexp_parser/expression/methods/escape_sequence_char.rb
                --- /tmp/20250123-2984-sypuvb	2025-01-23 03:24:33.810997118 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression/methods/escape_sequence_char.rb	2025-01-23 03:24:33.801997093 +0000
                @@ -0,0 +1,5 @@
                +Regexp::Expression::EscapeSequence::Base.class_eval do
                +  def char
                +    codepoint.chr('utf-8')
                +  end
                +end
        lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb
                --- /tmp/20250123-2984-pm6ask	2025-01-23 03:24:33.812997124 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb	2025-01-23 03:24:33.801997093 +0000
                @@ -0,0 +1,68 @@
                +module Regexp::Expression::EscapeSequence
                +  AsciiEscape.class_eval { def codepoint; 0x1B end }
                +  Backspace.class_eval   { def codepoint; 0x8  end }
                +  Bell.class_eval        { def codepoint; 0x7  end }
                +  FormFeed.class_eval    { def codepoint; 0xC  end }
                +  Newline.class_eval     { def codepoint; 0xA  end }
                +  Return.class_eval      { def codepoint; 0xD  end }
                +  Tab.class_eval         { def codepoint; 0x9  end }
                +  VerticalTab.class_eval { def codepoint; 0xB  end }
                +
                +  Literal.class_eval     { def codepoint; text[1].ord end }
                +
                +  Octal.class_eval       { def codepoint; text[/\d+/].to_i(8) end }
                +
                +  Hex.class_eval         { def codepoint; text[/\h+/].hex end }
                +  Codepoint.class_eval   { def codepoint; text[/\h+/].hex end }
                +
                +  CodepointList.class_eval do
                +    # Maybe this should be a unique top-level expression class?
                +    def char
                +      raise NoMethodError, 'CodepointList responds only to #chars'
                +    end
                +
                +    def codepoint
                +      raise NoMethodError, 'CodepointList responds only to #codepoints'
                +    end
                +
                +    def chars
                +      codepoints.map { |cp| cp.chr('utf-8') }
                +    end
                +
                +    def codepoints
                +      text.scan(/\h+/).map(&:hex)
                +    end
                +  end
                +
                +  AbstractMetaControlSequence.class_eval do
                +    private
                +
                +    def control_sequence_to_s(control_sequence)
                +      five_lsb = control_sequence.unpack('B*').first[-5..-1]
                +      ["000#{five_lsb}"].pack('B*')
                +    end
                +
                +    def meta_char_to_codepoint(meta_char)
                +      byte_value = meta_char.ord
                +      byte_value < 128 ? byte_value + 128 : byte_value
                +    end
                +  end
                +
                +  Control.class_eval do
                +    def codepoint
                +      control_sequence_to_s(text).ord
                +    end
                +  end
                +
                +  Meta.class_eval do
                +    def codepoint
                +      meta_char_to_codepoint(text[-1])
                +    end
                +  end
                +
                +  MetaControl.class_eval do
                +    def codepoint
                +      meta_char_to_codepoint(control_sequence_to_s(text))
                +    end
                +  end
                +end
        lib/regexp_parser/expression/methods/referenced_expressions.rb
                --- /tmp/20250123-2984-c8vk8d	2025-01-23 03:24:33.814997130 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression/methods/referenced_expressions.rb	2025-01-23 03:24:33.802997096 +0000
                @@ -0,0 +1,28 @@
                +module Regexp::Expression
                +  module ReferencedExpressions
                +    attr_accessor :referenced_expressions
                +
                +    def referenced_expression
                +      referenced_expressions && referenced_expressions.first
                +    end
                +
                +    def initialize_copy(orig)
                +      exp_id = [self.class, self.starts_at]
                +
                +      # prevent infinite recursion for recursive subexp calls
                +      copied = self.class.instance_eval { @copied_ref_exps ||= {} }
                +      self.referenced_expressions =
                +        if copied[exp_id]
                +          orig.referenced_expressions
                +        else
                +          copied[exp_id] = true
                +          orig.referenced_expressions && orig.referenced_expressions.map(&:dup)
                +        end
                +      copied.clear
                +
                +      super
                +    end
                +  end
                +
                +  Base.include ReferencedExpressions
                +end
      * Changed:
        lib/regexp_parser/expression.rb
                --- /tmp/d20250123-2984-vxr4ci/regexp_parser-2.9.3/lib/regexp_parser/expression.rb	2025-01-23 03:24:33.786997051 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression.rb	2025-01-23 03:24:33.798997085 +0000
                @@ -27,0 +28,2 @@
                +require_relative 'expression/methods/escape_sequence_char'
                +require_relative 'expression/methods/escape_sequence_codepoint'
                @@ -34,0 +37 @@
                +require_relative 'expression/methods/referenced_expressions'
        lib/regexp_parser/expression/classes/backreference.rb
                --- /tmp/d20250123-2984-vxr4ci/regexp_parser-2.9.3/lib/regexp_parser/expression/classes/backreference.rb	2025-01-23 03:24:33.787997054 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression/classes/backreference.rb	2025-01-23 03:24:33.799997088 +0000
                @@ -3,20 +3 @@
                -    class Base < Regexp::Expression::Base
                -      attr_accessor :referenced_expression
                -
                -      def initialize_copy(orig)
                -        exp_id = [self.class, self.starts_at]
                -
                -        # prevent infinite recursion for recursive subexp calls
                -        copied = @@copied ||= {}
                -        self.referenced_expression =
                -          if copied[exp_id]
                -            orig.referenced_expression
                -          else
                -            copied[exp_id] = true
                -            orig.referenced_expression.dup
                -          end
                -        copied.clear
                -
                -        super
                -      end
                -    end
                +    class Base < Regexp::Expression::Base; end
        lib/regexp_parser/expression/classes/conditional.rb
                --- /tmp/d20250123-2984-vxr4ci/regexp_parser-2.9.3/lib/regexp_parser/expression/classes/conditional.rb	2025-01-23 03:24:33.787997054 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression/classes/conditional.rb	2025-01-23 03:24:33.800997091 +0000
                @@ -10,2 +9,0 @@
                -      attr_accessor :referenced_expression
                -
                @@ -18,5 +15,0 @@
                -
                -      def initialize_copy(orig)
                -        self.referenced_expression = orig.referenced_expression.dup
                -        super
                -      end
                @@ -28,2 +20,0 @@
                -      attr_accessor :referenced_expression
                -
                @@ -56,5 +46,0 @@
                -      end
                -
                -      def initialize_copy(orig)
                -        self.referenced_expression = orig.referenced_expression.dup
                -        super
        lib/regexp_parser/expression/classes/escape_sequence.rb
                --- /tmp/d20250123-2984-vxr4ci/regexp_parser-2.9.3/lib/regexp_parser/expression/classes/escape_sequence.rb	2025-01-23 03:24:33.787997054 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/expression/classes/escape_sequence.rb	2025-01-23 03:24:33.800997091 +0000
                @@ -3,4 +3 @@
                -    class Base < Regexp::Expression::Base
                -      def codepoint
                -        char.ord
                -      end
                +    Base        = Class.new(Regexp::Expression::Base)
                @@ -8,90 +5,21 @@
                -      if ''.respond_to?(:undump)
                -        def char
                -          %("#{text}").undump
                -        end
                -      else
                -        # poor man's unescape without using eval
                -        require 'yaml'
                -        def char
                -          YAML.load(%Q(---\n"#{text}"\n))
                -        end
                -      end
                -    end
                -
                -    class Literal < EscapeSequence::Base
                -      def char
                -        text[1..-1]
                -      end
                -    end
                -
                -    class AsciiEscape   < EscapeSequence::Base; end
                -    class Backspace     < EscapeSequence::Base; end
                -    class Bell          < EscapeSequence::Base; end
                -    class FormFeed      < EscapeSequence::Base; end
                -    class Newline       < EscapeSequence::Base; end
                -    class Return        < EscapeSequence::Base; end
                -    class Tab           < EscapeSequence::Base; end
                -    class VerticalTab   < EscapeSequence::Base; end
                -
                -    class Hex           < EscapeSequence::Base; end
                -    class Codepoint     < EscapeSequence::Base; end
                -
                -    class CodepointList < EscapeSequence::Base
                -      def char
                -        raise NoMethodError, 'CodepointList responds only to #chars'
                -      end
                -
                -      def codepoint
                -        raise NoMethodError, 'CodepointList responds only to #codepoints'
                -      end
                -
                -      def chars
                -        codepoints.map { |cp| cp.chr('utf-8') }
                -      end
                -
                -      def codepoints
                -        text.scan(/\h+/).map(&:hex)
                -      end
                -    end
                -
                -    class Octal < EscapeSequence::Base
                -      def char
                -        text[1..-1].to_i(8).chr('utf-8')
                -      end
                -    end
                -
                -    class AbstractMetaControlSequence < EscapeSequence::Base
                -      def char
                -        codepoint.chr('utf-8')
                -      end
                -
                -      private
                -
                -      def control_sequence_to_s(control_sequence)
                -        five_lsb = control_sequence.unpack('B*').first[-5..-1]
                -        ["000#{five_lsb}"].pack('B*')
                -      end
                -
                -      def meta_char_to_codepoint(meta_char)
                -        byte_value = meta_char.ord
                -        byte_value < 128 ? byte_value + 128 : byte_value
                -      end
                -    end
                -
                -    class Control < AbstractMetaControlSequence
                -      def codepoint
                -        control_sequence_to_s(text).ord
                -      end
                -    end
                -
                -    class Meta < AbstractMetaControlSequence
                -      def codepoint
                -        meta_char_to_codepoint(text[-1])
                -      end
                -    end
                -
                -    class MetaControl < AbstractMetaControlSequence
                -      def codepoint
                -        meta_char_to_codepoint(control_sequence_to_s(text))
                -      end
                -    end
                +    AsciiEscape = Class.new(Base) # \e
                +    Backspace   = Class.new(Base) # \b
                +    Bell        = Class.new(Base) # \a
                +    FormFeed    = Class.new(Base) # \f
                +    Newline     = Class.new(Base) # \n
                +    Return      = Class.new(Base) # \r
                +    Tab         = Class.new(Base) # \t
                +    VerticalTab = Class.new(Base) # \v
                +
                +    Literal     = Class.new(Base) # e.g. \j, \@, \😀 (ineffectual escapes)
                +
                +    Octal       = Class.new(Base) # e.g. \012
                +    Hex         = Class.new(Base) # e.g. \x0A
                +    Codepoint   = Class.new(Base) # e.g. \u000A
                +
                +    CodepointList = Class.new(Base) # e.g. \u{A B}
                +
                +    AbstractMetaControlSequence = Class.new(Base)
                +    Control                     = Class.new(AbstractMetaControlSequence) # e.g. \cB
                +    Meta                        = Class.new(AbstractMetaControlSequence) # e.g. \M-Z
                +    MetaControl                 = Class.new(AbstractMetaControlSequence) # e.g. \M-\cX
        lib/regexp_parser/parser.rb
                --- /tmp/d20250123-2984-vxr4ci/regexp_parser-2.9.3/lib/regexp_parser/parser.rb	2025-01-23 03:24:33.791997065 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/parser.rb	2025-01-23 03:24:33.803997099 +0000
                @@ -583 +583 @@
                -    targets = { 0 => root }
                +    targets = { 0 => [root] }
                @@ -586,2 +586,5 @@
                -      exp.is_a?(Group::Capture) && targets[exp.identifier] = exp
                -      referrers << exp if exp.referential?
                +      if exp.referential?
                +        referrers << exp
                +      elsif exp.is_a?(Group::Capture)
                +        (targets[exp.identifier] ||= []) << exp
                +      end
                @@ -589 +592 @@
                -    # assign reference expression to referring expressions
                +    # assign referenced expressions to referring expressions
                @@ -592 +595 @@
                -      exp.referenced_expression = targets[exp.reference] ||
                +      exp.referenced_expressions = targets[exp.reference] ||
        lib/regexp_parser/version.rb
                --- /tmp/d20250123-2984-vxr4ci/regexp_parser-2.9.3/lib/regexp_parser/version.rb	2025-01-23 03:24:33.797997082 +0000
                +++ /tmp/d20250123-2984-vxr4ci/regexp_parser-2.10.0/lib/regexp_parser/version.rb	2025-01-23 03:24:33.810997118 +0000
                @@ -3 +3 @@
                -    VERSION = '2.9.3'
                +    VERSION = '2.10.0'

Copy link

gem compare rubocop 1.69.2 1.71.0

Compared versions: ["1.69.2", "1.71.0"]
  DIFFERENT date:
    1.69.2: 2024-12-12 00:00:00 UTC
    1.71.0: 2025-01-22 00:00:00 UTC
  DIFFERENT metadata:
    1.69.2: {"homepage_uri" => "https://rubocop.org/", "changelog_uri" => "https://github.com/rubocop/rubocop/releases/tag/v1.69.2", "source_code_uri" => "https://github.com/rubocop/rubocop/", "documentation_uri" => "https://docs.rubocop.org/rubocop/1.69/", "bug_tracker_uri" => "https://github.com/rubocop/rubocop/issues", "rubygems_mfa_required" => "true"}
    1.71.0: {"homepage_uri" => "https://rubocop.org/", "changelog_uri" => "https://github.com/rubocop/rubocop/releases/tag/v1.71.0", "source_code_uri" => "https://github.com/rubocop/rubocop/", "documentation_uri" => "https://docs.rubocop.org/rubocop/1.71/", "bug_tracker_uri" => "https://github.com/rubocop/rubocop/issues", "rubygems_mfa_required" => "true"}
  DIFFERENT rubygems_version:
    1.69.2: 3.4.22
    1.71.0: 3.6.2
  DIFFERENT version:
    1.69.2: 1.69.2
    1.71.0: 1.71.0
  DIFFERENT files:
    1.69.2->1.71.0:
      * Added:
            lib/rubocop/cop/internal_affairs/cop_enabled.rb +85/-0
            lib/rubocop/cop/internal_affairs/on_send_without_on_csend.rb +90/-0
            lib/rubocop/cop/lint/array_literal_in_regexp.rb +119/-0
            lib/rubocop/cop/lint/constant_reassignment.rb +152/-0
            lib/rubocop/cop/lint/shared_mutable_default.rb +65/-0
            lib/rubocop/cop/mixin/hash_subset.rb +170/-0
            lib/rubocop/cop/style/hash_slice.rb +65/-0
            lib/rubocop/cop/style/it_assignment.rb +36/-0
            lib/rubocop/lsp/diagnostic.rb +189/-0
            lib/rubocop/lsp/stdin_runner.rb +83/-0
            lib/ruby_lsp/rubocop/addon.rb +78/-0
            lib/ruby_lsp/rubocop/wraps_built_in_lsp_runtime.rb +50/-0
      * Changed:
            LICENSE.txt +1/-1
            README.md +2/-2
            config/default.yml +36/-2
            lib/rubocop.rb +6/-0
            lib/rubocop/cli/command/execute_runner.rb +3/-3
            lib/rubocop/cli/command/show_cops.rb +24/-2
            lib/rubocop/comment_config.rb +1/-1
            lib/rubocop/config.rb +13/-4
            lib/rubocop/config_loader.rb +4/-0
            lib/rubocop/config_loader_resolver.rb +14/-3
            lib/rubocop/config_validator.rb +18/-8
            lib/rubocop/cop/base.rb +6/-0
            lib/rubocop/cop/bundler/gem_comment.rb +1/-1
            lib/rubocop/cop/internal_affairs.rb +2/-0
            lib/rubocop/cop/internal_affairs/location_expression.rb +2/-1
            lib/rubocop/cop/internal_affairs/node_first_or_last_argument.rb +3/-2
            lib/rubocop/cop/internal_affairs/node_type_predicate.rb +4/-3
            lib/rubocop/cop/internal_affairs/redundant_source_range.rb +2/-1
            lib/rubocop/cop/internal_affairs/single_line_comparison.rb +5/-4
            lib/rubocop/cop/layout/argument_alignment.rb +2/-8
            lib/rubocop/cop/layout/class_structure.rb +7/-7
            lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +1/-0
            lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +1/-1
            lib/rubocop/cop/layout/extra_spacing.rb +1/-1
            lib/rubocop/cop/layout/first_argument_indentation.rb +2/-7
            lib/rubocop/cop/layout/first_array_element_indentation.rb +2/-7
            lib/rubocop/cop/layout/first_hash_element_indentation.rb +2/-7
            lib/rubocop/cop/layout/first_hash_element_line_break.rb +1/-1
            lib/rubocop/cop/layout/hash_alignment.rb +6/-4
            lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1/-0
            lib/rubocop/cop/layout/line_continuation_spacing.rb +7/-1
            lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +1/-1
            lib/rubocop/cop/layout/line_length.rb +1/-0
            lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +1/-1
            lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +25/-0
            lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +1/-0
            lib/rubocop/cop/layout/redundant_line_break.rb +1/-1
            lib/rubocop/cop/layout/space_after_method_name.rb +1/-1
            lib/rubocop/cop/layout/space_around_keyword.rb +1/-0
            lib/rubocop/cop/layout/space_around_operators.rb +3/-3
            lib/rubocop/cop/layout/trailing_whitespace.rb +5/-3
            lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +1/-1
            lib/rubocop/cop/lint/duplicate_set_element.rb +20/-7
            lib/rubocop/cop/lint/float_comparison.rb +5/-2
            lib/rubocop/cop/lint/float_out_of_range.rb +1/-1
            lib/rubocop/cop/lint/literal_in_interpolation.rb +23/-5
            lib/rubocop/cop/lint/mixed_case_range.rb +1/-1
            lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +1/-1
            lib/rubocop/cop/lint/nested_method_definition.rb +5/-1
            lib/rubocop/cop/lint/non_atomic_file_operation.rb +4/-3
            lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb +17/-30
            lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +2/-1
            lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb +1/-1
            lib/rubocop/cop/lint/redundant_string_coercion.rb +2/-2
            lib/rubocop/cop/lint/rescue_exception.rb +1/-1
            lib/rubocop/cop/lint/safe_navigation_chain.rb +7/-0
            lib/rubocop/cop/lint/syntax.rb +4/-1
            lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb +1/-4
            lib/rubocop/cop/lint/useless_assignment.rb +1/-1
            lib/rubocop/cop/lint/useless_numeric_operation.rb +2/-1
            lib/rubocop/cop/lint/void.rb +3/-2
            lib/rubocop/cop/metrics/collection_literal_length.rb +7/-0
            lib/rubocop/cop/metrics/cyclomatic_complexity.rb +1/-1
            lib/rubocop/cop/metrics/method_length.rb +8/-1
            lib/rubocop/cop/metrics/perceived_complexity.rb +1/-1
            lib/rubocop/cop/mixin/check_line_breakable.rb +7/-7
            lib/rubocop/cop/mixin/comments_help.rb +2/-0
            lib/rubocop/cop/mixin/dig_help.rb +1/-1
            lib/rubocop/cop/mixin/frozen_string_literal.rb +1/-1
            lib/rubocop/cop/mixin/preceding_following_alignment.rb +26/-16
            lib/rubocop/cop/mixin/space_before_punctuation.rb +1/-1
            lib/rubocop/cop/mixin/statement_modifier.rb +8/-3
            lib/rubocop/cop/mixin/string_literals_help.rb +1/-1
            lib/rubocop/cop/mixin/trailing_comma.rb +2/-2
            lib/rubocop/cop/naming/block_forwarding.rb +1/-1
            lib/rubocop/cop/security/compound_hash.rb +1/-0
            lib/rubocop/cop/style/access_modifier_declarations.rb +32/-1
            lib/rubocop/cop/style/and_or.rb +1/-1
            lib/rubocop/cop/style/arguments_forwarding.rb +1/-4
            lib/rubocop/cop/style/array_first_last.rb +18/-2
            lib/rubocop/cop/style/block_delimiters.rb +6/-19
            lib/rubocop/cop/style/class_and_module_children.rb +5/-2
            lib/rubocop/cop/style/collection_methods.rb +1/-1
            lib/rubocop/cop/style/conditional_assignment.rb +3/-1
            lib/rubocop/cop/style/each_for_simple_loop.rb +4/-7
            lib/rubocop/cop/style/empty_else.rb +4/-2
            lib/rubocop/cop/style/empty_literal.rb +1/-1
            lib/rubocop/cop/style/empty_method.rb +1/-1
            lib/rubocop/cop/style/exact_regexp_match.rb +3/-10
            lib/rubocop/cop/style/exponential_notation.rb +1/-1
            lib/rubocop/cop/style/fetch_env_var.rb +1/-1
            lib/rubocop/cop/style/float_division.rb +8/-4
            lib/rubocop/cop/style/frozen_string_literal_comment.rb +1/-1
            lib/rubocop/cop/style/hash_each_methods.rb +1/-1
            lib/rubocop/cop/style/hash_except.rb +9/-148
            lib/rubocop/cop/style/hash_syntax.rb +5/-2
            lib/rubocop/cop/style/map_to_set.rb +3/-2
            lib/rubocop/cop/style/method_call_with_args_parentheses.rb +2/-0
            lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +11/-1
            lib/rubocop/cop/style/method_call_without_args_parentheses.rb +2/-1
            lib/rubocop/cop/style/missing_else.rb +2/-0
            lib/rubocop/cop/style/multiple_comparison.rb +26/-20
            lib/rubocop/cop/style/mutable_constant.rb +2/-2
            lib/rubocop/cop/style/object_then.rb +13/-15
            lib/rubocop/cop/style/open_struct_use.rb +4/-4
            lib/rubocop/cop/style/quoted_symbols.rb +1/-1
            lib/rubocop/cop/style/raise_args.rb +6/-4
            lib/rubocop/cop/style/random_with_offset.rb +3/-3
            lib/rubocop/cop/style/redundant_current_directory_in_path.rb +2/-1
            lib/rubocop/cop/style/redundant_exception.rb +1/-1
            lib/rubocop/cop/style/redundant_freeze.rb +1/-1
            lib/rubocop/cop/style/redundant_initialize.rb +12/-3
            lib/rubocop/cop/style/redundant_line_continuation.rb +34/-13
            lib/rubocop/cop/style/redundant_parentheses.rb +4/-4
            lib/rubocop/cop/style/redundant_regexp_argument.rb +3/-0
            lib/rubocop/cop/style/redundant_regexp_character_class.rb +1/-1
            lib/rubocop/cop/style/redundant_regexp_escape.rb +1/-1
            lib/rubocop/cop/style/redundant_self_assignment.rb +6/-5
            lib/rubocop/cop/style/safe_navigation.rb +1/-1
            lib/rubocop/cop/style/send_with_literal_method_name.rb +2/-1
            lib/rubocop/cop/style/single_line_block_params.rb +1/-1
            lib/rubocop/cop/style/single_line_do_end_block.rb +1/-2
            lib/rubocop/cop/style/single_line_methods.rb +2/-3
            lib/rubocop/cop/style/slicing_with_range.rb +40/-11
            lib/rubocop/cop/style/sole_nested_conditional.rb +1/-1
            lib/rubocop/cop/style/string_methods.rb +1/-1
            lib/rubocop/cop/style/super_arguments.rb +63/-15
            lib/rubocop/cop/style/trailing_comma_in_arguments.rb +4/-1
            lib/rubocop/cop/style/yoda_condition.rb +8/-4
            lib/rubocop/cop/style/yoda_expression.rb +1/-0
            lib/rubocop/cop/util.rb +9/-2
            lib/rubocop/cops_documentation_generator.rb +13/-13
            lib/rubocop/directive_comment.rb +9/-8
            lib/rubocop/formatter/formatter_set.rb +1/-1
            lib/rubocop/lsp/logger.rb +2/-2
            lib/rubocop/lsp/routes.rb +7/-23
            lib/rubocop/lsp/runtime.rb +15/-49
            lib/rubocop/options.rb +2/-1
            lib/rubocop/path_util.rb +11/-8
            lib/rubocop/result_cache.rb +13/-13
            lib/rubocop/rspec/expect_offense.rb +6/-2
            lib/rubocop/rspec/shared_contexts.rb +4/-1
            lib/rubocop/runner.rb +5/-6
            lib/rubocop/target_finder.rb +1/-0
            lib/rubocop/target_ruby.rb +15/-0
            lib/rubocop/version.rb +1/-1
  DIFFERENT extra_rdoc_files:
    1.69.2->1.71.0:
      * Changed:
            LICENSE.txt +1/-1
            README.md +2/-2

Copy link

gem compare --diff rubocop 1.69.2 1.71.0

Diff too large (219303 chars)

Copy link

gem compare unicode-display_width 3.1.2 3.1.4

Compared versions: ["3.1.2", "3.1.4"]
  DIFFERENT date:
    3.1.2: 2024-11-20 00:00:00 UTC
    3.1.4: 2025-01-13 00:00:00 UTC
  DIFFERENT version:
    3.1.2: 3.1.2
    3.1.4: 3.1.4
  DIFFERENT files:
    3.1.2->3.1.4:
      * Changed:
            CHANGELOG.md +14/-0
            README.md +14/-5
            lib/unicode/display_width.rb +11/-3
            lib/unicode/display_width/constants.rb +1/-1
  DIFFERENT extra_rdoc_files:
    3.1.2->3.1.4:
      * Changed:
            README.md +14/-5
            CHANGELOG.md +14/-0

Copy link

gem compare --diff unicode-display_width 3.1.2 3.1.4

Compared versions: ["3.1.2", "3.1.4"]
  DIFFERENT files:
    3.1.2->3.1.4:
      * Changed:
        CHANGELOG.md
                --- /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.2/CHANGELOG.md	2025-01-23 03:25:24.637148296 +0000
                +++ /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.4/CHANGELOG.md	2025-01-23 03:25:24.639148302 +0000
                @@ -2,0 +3,13 @@
                +## 3.1.4
                +
                +- Fix that skin tone modifiers were ignored when used in a non-ZWJ sequence
                +  context (= single emoji char + modifier) #29
                +- Add more docs and specs about modifier handling
                +
                +## 3.1.3
                +
                +Better handling of non-UTF-8 strings, patch by @Earlopain:
                +
                +- Data with *BINARY* encoding is interpreted as UTF-8, if possible
                +- Use `invalid: :replace` and `undef: :replace` options when converting to UTF-8
                +
                @@ -29,0 +43 @@
                +
        README.md
                --- /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.2/README.md	2025-01-23 03:25:24.637148296 +0000
                +++ /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.4/README.md	2025-01-23 03:25:24.639148302 +0000
                @@ -73,0 +74,5 @@
                +### Encoding Notes
                +
                +- Data with *BINARY* encoding is interpreted as UTF-8, if possible
                +- Non-UTF-8 strings are converted to UTF-8 before measuring, using the [`{invalid: :replace, undef: :replace}`) options](https://ruby-doc.org/3.3.5/encodings_rdoc.html#label-Encoding+Options)
                +
                @@ -98,0 +104,2 @@
                +Finally, it varies if Skin Tone Modifiers can be applied to all characters or just to those with the "Emoji Base" property.
                +
                @@ -101,4 +108,6 @@
                -Basic/Single Emoji character without Variation Selector | No special handling
                -Basic/Single Emoji character with VS15 (Text)           | No special handling
                -Basic/Single Emoji character with VS16 (Emoji)          | 2 or East Asian Width (see table below)
                -Emoji Sequence                                          | 2 if Emoji belongs to configured Emoji set (see table below)
                +Basic/Single Emoji character without Variation Selector   | No special handling
                +Basic/Single Emoji character with VS15 (Text)             | No special handling
                +Basic/Single Emoji character with VS16 (Emoji)            | 2 or East Asian Width (see table below)
                +Single Emoji character with Skin Tone Modifier            | 2
                +Skin Tone Modifier used in isolation or with invalid base | 2 if Emoji mode is configured to `:rgi` / `:rgi_at`
                +Emoji Sequence                                            | 2 if Emoji belongs to configured Emoji set (see table below)
                @@ -129 +138 @@
                -Please note that Emoji display and number of terminal columns used might differs a lot. For example, it might be the case that a terminal does not understand which Emoji to display, but still manages to calculate the proper amount of terminal cells. The automatic Emoji support level per terminal only considers the latter (cursor position), not the actual Emoji image(s) displayed. Please [open an issue](https://github.com/janlelis/unicode-display_width/issues/new) if you notice your terminal application could use a better default value. Also see the [ucs-detect project](https://ucs-detect.readthedocs.io/results.html), which is a great resource that compares various terminal's Unicode/Emoji capabilities.
                +Please note that Emoji display and number of terminal columns used might differs a lot. For example, it might be the case that a terminal does not understand which Emoji to display, but still manages to calculate the proper amount of terminal cells. The automatic Emoji support level per terminal only considers the latter (cursor position), not the actual Emoji image(s) displayed. Please [open an issue](https://github.com/janlelis/unicode-display_width/issues/new) if you notice your terminal application could use a better default value. Also see the [ucs-detect project](https://ucs-detect.readthedocs.io/results.html), which is a great resource that compares various terminal's Unicode/Emoji capabilities. You can visually check how your terminals renders different kind of Emoji types with the [terminal-emoji-width.rb script](https://github.com/janlelis/unicode-display_width/blob/main/misc/terminal-emoji-width.rb).
        lib/unicode/display_width.rb
                --- /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.2/lib/unicode/display_width.rb	2025-01-23 03:25:24.638148299 +0000
                +++ /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.4/lib/unicode/display_width.rb	2025-01-23 03:25:24.640148305 +0000
                @@ -45 +45,3 @@
                -    REGEX_EMOJI_ALL_SEQUENCES = Regexp.union(/.[\u{1F3FB}-\u{1F3FF}\u{FE0F}]?(\u{200D}.[\u{1F3FB}-\u{1F3FF}\u{FE0F}]?)+/, Unicode::Emoji::REGEX_EMOJI_KEYCAP)
                +
                +    # ebase = Unicode::Emoji::REGEX_PROP_MODIFIER_BASE.source
                +    REGEX_EMOJI_ALL_SEQUENCES = Regexp.union(/.[\u{1F3FB}-\u{1F3FF}\u{FE0F}]?(\u{200D}.[\u{1F3FB}-\u{1F3FF}\u{FE0F}]?)+|.[\u{1F3FB}-\u{1F3FF}]/, Unicode::Emoji::REGEX_EMOJI_KEYCAP)
                @@ -50 +52,8 @@
                -      string = string.encode(Encoding::UTF_8) unless string.encoding == Encoding::UTF_8
                +      # Binary strings don't make much sense when calculating display width.
                +      # Assume it's valid UTF-8
                +      if string.encoding == Encoding::BINARY && !string.force_encoding(Encoding::UTF_8).valid_encoding?
                +        # Didn't work out, go back to binary
                +        string.force_encoding(Encoding::BINARY)
                +      end
                +
                +      string = string.encode(Encoding::UTF_8, invalid: :replace, undef: :replace) unless string.encoding == Encoding::UTF_8
                @@ -239 +247,0 @@
                -
        lib/unicode/display_width/constants.rb
                --- /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.2/lib/unicode/display_width/constants.rb	2025-01-23 03:25:24.638148299 +0000
                +++ /tmp/d20250123-10466-fri7zp/unicode-display_width-3.1.4/lib/unicode/display_width/constants.rb	2025-01-23 03:25:24.640148305 +0000
                @@ -5 +5 @@
                -    VERSION = "3.1.2"
                +    VERSION = "3.1.4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants