Sha256: 6a2320d0e26004bd189d6518b3d552ac0439c3f18c25c4006597cc2490b70980

Contents?: true

Size: 510 Bytes

Versions: 9

Compression:

Stored size: 510 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

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.'.freeze

        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

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-0.41.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.41.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.40.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.39.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.38.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.37.2 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.37.1 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.37.0 lib/rubocop/cop/style/ascii_identifiers.rb
rubocop-0.36.0 lib/rubocop/cop/style/ascii_identifiers.rb