Skip to content
  • Koichi ITO's avatar
    5726b1d1
    Use RuboCop Performance 1.16.0 · 5726b1d1
    Koichi ITO authored
    ## Summary
    
    This PR bumps RuboCop Performance to 1.16.0 and suppresses the following new offenses:
    
    ```console
    % bundle exec rubocop
    (snip)
    
    Offenses:
    
    actionpack/lib/action_dispatch/routing/mapper.rb:309:16:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
                if /#/.match?(to)
                   ^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/routing/mapper.rb:1643:18:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
                  if /#/.match?(to)
                     ^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/routing/route_set.rb:887:67:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            path = Journey::Router::Utils.normalize_path(path) unless %r{://}.match?(path)
                                                                      ^^^^^^^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/testing/assertions/routing.rb:86:12:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            if %r{://}.match?(expected_path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/testing/assertions/routing.rb:205:14:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
              if %r{://}.match?(path)
                 ^^^^^^^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/testing/integration.rb:235:12:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            if %r{://}.match?(path)
               ^^^^^^^^^^^^^^^^^^^^
    actiontext/bin/webpack:18:6:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
      if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 150))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    actiontext/bin/webpack-dev-server:18:6:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
      if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 150))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb:120:64:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
              elsif column.type == :uuid && value.is_a?(String) && /\(\)/.match?(value)
                                                                   ^^^^^^^^^^^^^^^^^^^^
    railties/lib/rails/commands/secrets/secrets_command.rb:28:12:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            if /secrets\.yml\.enc/.match?(error.message)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    3088 files inspected, 10 offenses detected, 10 offenses autocorrectable
    ```
    
    ## Additional Information
    
    This behavior change is based on:
    https://github.com/rubocop/rubocop-performance/pull/332
    5726b1d1
    Use RuboCop Performance 1.16.0
    Koichi ITO authored
    ## Summary
    
    This PR bumps RuboCop Performance to 1.16.0 and suppresses the following new offenses:
    
    ```console
    % bundle exec rubocop
    (snip)
    
    Offenses:
    
    actionpack/lib/action_dispatch/routing/mapper.rb:309:16:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
                if /#/.match?(to)
                   ^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/routing/mapper.rb:1643:18:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
                  if /#/.match?(to)
                     ^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/routing/route_set.rb:887:67:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            path = Journey::Router::Utils.normalize_path(path) unless %r{://}.match?(path)
                                                                      ^^^^^^^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/testing/assertions/routing.rb:86:12:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            if %r{://}.match?(expected_path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/testing/assertions/routing.rb:205:14:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
              if %r{://}.match?(path)
                 ^^^^^^^^^^^^^^^^^^^^
    actionpack/lib/action_dispatch/testing/integration.rb:235:12:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            if %r{://}.match?(path)
               ^^^^^^^^^^^^^^^^^^^^
    actiontext/bin/webpack:18:6:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
      if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 150))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    actiontext/bin/webpack-dev-server:18:6:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
      if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 150))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb:120:64:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
              elsif column.type == :uuid && value.is_a?(String) && /\(\)/.match?(value)
                                                                   ^^^^^^^^^^^^^^^^^^^^
    railties/lib/rails/commands/secrets/secrets_command.rb:28:12:
    C: [Correctable] Performance/StringInclude: Use String#include? instead of a regex match with literal-only pattern.
            if /secrets\.yml\.enc/.match?(error.message)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    3088 files inspected, 10 offenses detected, 10 offenses autocorrectable
    ```
    
    ## Additional Information
    
    This behavior change is based on:
    https://github.com/rubocop/rubocop-performance/pull/332
Loading