Sha256: 47c0faa5b382d13690d5d4bf1261dda461638738cf1f3111c87c720d7df00bd9

Contents?: true

Size: 473 Bytes

Versions: 14

Compression:

Stored size: 473 Bytes

Contents

# encoding: utf-8

module RuboCop
  module Cop
    module Style
      # This cop checks for non-ascii characters in identifier 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

14 entries across 14 versions & 1 rubygems

Version Path
rubocop-0.35.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.35.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.34.2 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.34.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.34.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.33.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.32.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.32.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.31.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.30.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.30.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.29.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.29.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.28.0 lib/rubocop/cop/style/ascii_identifiers.rb