Sha256: bd3c335fd9130ca89d362b1df7ff590407c515f1f40750d14fc1d3342801dab9

Contents?: true

Size: 474 Bytes

Versions: 6832

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Common functionality for cops checking single/double quotes.
    module StringLiteralsHelp
      include StringHelp

      private

      def wrong_quotes?(node)
        src = node.source
        return false if src.start_with?('%', '?')

        if style == :single_quotes
          !double_quotes_required?(src)
        else
          src !~ /" | \\[^'] | \#(@|\{)/x
        end
      end
    end
  end
end

Version data entries

6,832 entries across 6,807 versions & 28 rubygems

Version Path
rubocop-0.63.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.62.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.61.1 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.61.0 lib/rubocop/cop/mixin/string_literals_help.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/string_literals_help.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/string_literals_help.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/string_literals_help.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.60.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.59.2 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.59.1 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-0.59.0 lib/rubocop/cop/mixin/string_literals_help.rb