Sha256: b7c248d935c127ca7510413dcd7fdea39af1342185fcf7fd59c64987d3f0e233

Contents?: true

Size: 918 Bytes

Versions: 190

Compression:

Stored size: 918 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  # ...
  module AST
    # Responsible for compatibility with main gem
    # @api private
    module RuboCopCompatibility
      INCOMPATIBLE_COPS = {
        '0.89.0' => 'Layout/LineLength',
        '0.92.0' => 'Style/MixinUsage'
      }.freeze
      def rubocop_loaded
        loaded = Gem::Version.new(RuboCop::Version::STRING)
        incompatible = INCOMPATIBLE_COPS.select do |k, _v|
          loaded < Gem::Version.new(k)
        end.values
        return if incompatible.empty?

        warn <<~WARNING
          *** WARNING – Incompatible versions of `rubocop` and `rubocop-ast`
          You may encounter issues with the following \
          Cop#{'s' if incompatible.size > 1}: #{incompatible.join(', ')}
          Please upgrade rubocop to at least v#{INCOMPATIBLE_COPS.keys.last}
        WARNING
      end
    end

    extend RuboCopCompatibility
  end
end

Version data entries

190 entries across 184 versions & 24 rubygems

Version Path
rubocop-ast-1.41.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.40.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.39.0 lib/rubocop/ast/rubocop_compatibility.rb
siteimprove_api_client-1.0.1 vendor/bundle/ruby/3.2.0/gems/rubocop-ast-1.38.1/lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.38.1 lib/rubocop/ast/rubocop_compatibility.rb
tailscale_middleware-0.0.3 vendor/cache/ruby/3.4.0/gems/rubocop-ast-1.38.0/lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.38.0 lib/rubocop/ast/rubocop_compatibility.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-ast-1.31.3/lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.37.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.36.2 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.36.1 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.36.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.35.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.34.1 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.34.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.33.1 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.33.0 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.32.3 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.32.2 lib/rubocop/ast/rubocop_compatibility.rb
rubocop-ast-1.32.1 lib/rubocop/ast/rubocop_compatibility.rb