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
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.13.1/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
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/rspec/node.rb
rubocop-rspec-2.22.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.21.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.20.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.19.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.18.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.18.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.17.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.17.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.16.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.15.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.14.2 lib/rubocop/rspec/node.rb
rubocop-rspec-2.14.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.14.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.13.2 lib/rubocop/rspec/node.rb
rubocop-rspec-2.13.1 lib/rubocop/rspec/node.rb
rubocop-rspec-2.13.0 lib/rubocop/rspec/node.rb
rubocop-rspec-2.12.1 lib/rubocop/rspec/node.rb