Sha256: d2a6e52992a5aeefd84468a1c387059ee38d5c8f366b1c273fa5b46ff1a475f0

Contents?: true

Size: 499 Bytes

Versions: 41

Compression:

Stored size: 499 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.all?(&:recursive_literal_or_const?)
        else
          literal? || const_type?
        end
      end
    end
  end
end

Version data entries

41 entries across 37 versions & 4 rubygems

Version Path
rubocop-rspec-2.29.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.29.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.28.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.27.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.27.0 lib/rubocop/rspec/node.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.26.1/lib/rubocop/rspec/node.rb
rubocop-rspec-2.26.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.26.0 lib/rubocop/rspec/node.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/rspec/node.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.13.1/lib/rubocop/rspec/node.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.12.1/lib/rubocop/rspec/node.rb
rubocop-rspec-2.25.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.24.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.24.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.23.2 lib/rubocop/rspec/node.rb
rubocop-rspec-2.23.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.23.0 lib/rubocop/rspec/node.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/rspec/node.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/rspec/node.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/rspec/node.rb