Sha256: f23e8c943adda6e3b5f9f6ada4da94a9af5ad5ca80c7bdbcb5d1e1f1ef0e326c

Contents?: true

Size: 474 Bytes

Versions: 10

Compression:

Stored size: 474 Bytes

Contents

# encoding: utf-8

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|
            next unless t.type == :tIDENTIFIER && !t.text.ascii_only?
            add_offense(nil, t.pos)
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/ascii_identifiers.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.27.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.27.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.26.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.26.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.25.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.24.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.24.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.23.0 lib/rubocop/cop/style/ascii_identifiers.rb