Sha256: d6ba0ed4529b936fadabeebf1dfb752a0fce50a3157dfcd13d3e667f455b4f70

Contents?: true

Size: 507 Bytes

Versions: 16

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RSpec
    # RuboCop RSpec specific extensions of RuboCop::AST::Node
    module Node
      # In various cops we want to regard const as literal although it's not
      # strictly literal.
      def recursive_literal_or_const?
        case type
        when :begin, :pair, *AST::Node::COMPOSITE_LITERALS
          children.compact.all?(&:recursive_literal_or_const?)
        else
          literal? || const_type?
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-3.0.3/lib/rubocop/rspec/node.rb
rubocop-rspec-3.3.0 lib/rubocop/rspec/node.rb
rubocop-rspec-3.2.0 lib/rubocop/rspec/node.rb
rubocop-rspec-3.1.0 lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.5 lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.4 lib/rubocop/rspec/node.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-3.0.1/lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.3 lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.2 lib/rubocop/rspec/node.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.1/lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.1 lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.0 lib/rubocop/rspec/node.rb
rubocop-rspec-3.0.0.pre lib/rubocop/rspec/node.rb
rubocop-rspec-2.31.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.30.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.29.2 lib/rubocop/rspec/node.rb