Sha256: ffc98443d9137e47863b9dfee2d559973798dffa6298df63bb5d0fcc3b5fc9b4

Contents?: true

Size: 480 Bytes

Versions: 44

Compression:

Stored size: 480 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
          !/" | \\[^'] | \#(@|\{)/x.match?(src)
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 4 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/string_literals_help.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/string_literals_help.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/string_literals_help.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/string_literals_help.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/string_literals_help.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.91.1/lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.13.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.12.1 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.12.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.11.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.10.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.9.1 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.9.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.8.1 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.8.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.7.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.6.1 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.6.0 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.5.2 lib/rubocop/cop/mixin/string_literals_help.rb
rubocop-1.5.1 lib/rubocop/cop/mixin/string_literals_help.rb