Sha256: 59b7368bac7d2e6296217cbe968bfb9cdf36ab032568b2bfd11446e7f5e1c9aa

Contents?: true

Size: 500 Bytes

Versions: 31

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

31 entries across 31 versions & 1 rubygems

Version Path
rubocop-rspec-2.0.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.0.0.pre lib/rubocop/rspec/node.rb
rubocop-rspec-1.44.1 lib/rubocop/rspec/node.rb
rubocop-rspec-1.44.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.43.2 lib/rubocop/rspec/node.rb
rubocop-rspec-1.43.1 lib/rubocop/rspec/node.rb
rubocop-rspec-1.43.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.42.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.41.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.40.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.39.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.38.1 lib/rubocop/rspec/node.rb
rubocop-rspec-1.38.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.37.1 lib/rubocop/rspec/node.rb
rubocop-rspec-1.37.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.36.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.35.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.34.1 lib/rubocop/rspec/node.rb
rubocop-rspec-1.34.0 lib/rubocop/rspec/node.rb
rubocop-rspec-1.33.0 lib/rubocop/rspec/node.rb