class Rubocop::Cop::Style::AsciiIdentifiers

This cop checks for non-ascii characters in indentifier names.

Constants

MSG

Public Instance Methods

inspect(source_buffer, source, tokens, ast, comments) click to toggle source
# File lib/rubocop/cop/style/ascii_identifiers.rb, line 12
def inspect(source_buffer, source, tokens, ast, comments)
  tokens.each do |t|
    if t.type == :tIDENTIFIER && t.text =~ /[^\x00-\x7f]/
      add_offence(:convention, t.pos, MSG)
    end
  end
end