class Rubocop::Cop::Style::AsciiComments
This cop checks for non-ascii (non-English) characters in comments.
Constants
- MSG
Public Instance Methods
inspect(source_buffer, source, tokens, ast, comments)
click to toggle source
# File lib/rubocop/cop/style/ascii_comments.rb, line 11 def inspect(source_buffer, source, tokens, ast, comments) comments.each do |comment| if comment.text =~ /[^\x00-\x7f]/ add_offence(:convention, comment.loc, MSG) end end end