Sha256: 0a9d0b71dfa647d6f6a5f3894e20c43acca23aaf04508538b1eaae2e5b28b6c6

Contents?: true

Size: 500 Bytes

Versions: 15

Compression:

Stored size: 500 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 althought 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

15 entries across 15 versions & 2 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.9.0/lib/rubocop/rspec/node.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.9.0/lib/rubocop/rspec/node.rb
rubocop-rspec-2.11.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.11.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.10.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.9.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.8.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.7.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.6.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.5.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.4.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.3.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.2.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.1.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.0.1 lib/rubocop/rspec/node.rb