Class: RuboCop::Cop::Naming::AsciiFileName

Inherits:
Base
  • Object
show all
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/naming/ascii_file_name.rb

Overview

Examples:

EnforcedStyle: bar (default)

# Use only ASCII characters

# bad
automação.rb

# good
automacao.rb

Constant Summary collapse

MSG_ASCII =
'The name of this source file (`%<basename>s`) should use only ASCII characters.'

Instance Method Summary collapse

Instance Method Details

#on_new_investigationObject



22
23
24
25
26
27
# File 'lib/rubocop/cop/naming/ascii_file_name.rb', line 22

def on_new_investigation
  file_path = processed_source.file_path
  return if config.file_to_exclude?(file_path)

  for_bad_filename(file_path) { |range, msg| add_offense(range, message: msg) }
end