Sha256: d1688d71fb779ece6ade07d75992410a0fac54f918199a5a661241cb1dcfffec
Contents?: true
Size: 540 Bytes
Versions: 1
Compression:
Stored size: 540 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop class StringLiterals < Cop MSG = "Prefer single-quoted strings when you don't need " + 'string interpolation or special symbols.' def inspect(source, tokens, ast, comments) on_node(:str, ast, :dstr) do |s| text = s.to_a[0] if text !~ /['\n\t\r]/ && s.loc.expression.source[0] == '"' add_offence(:convention, s.loc.line, MSG) end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.8.0 | lib/rubocop/cop/string_literals.rb |