Sha256: 15b058a186c0d97486bccabe390eb1d43b7de55a52232106afab4077416fb927

Contents?: true

Size: 531 Bytes

Versions: 4

Compression:

Stored size: 531 Bytes

Contents

# encoding: utf-8

# rubocop:disable SymbolName

module Rubocop
  module Cop
    module Style
      # This cop checks for non-ascii characters in indentifier names.
      class AsciiIdentifiers < Cop
        MSG = 'Use only ascii symbols in identifiers.'

        def investigate(processed_source)
          processed_source.tokens.each do |t|
            if t.type == :tIDENTIFIER && t.text =~ /[^\x00-\x7f]/
              add_offence(:convention, t.pos, MSG)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.12.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.11.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.11.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.10.0 lib/rubocop/cop/style/ascii_identifiers.rb