Class: RuboCop::Cop::Sequel::MigrationName

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

Overview

MigrationName looks for migration files named with a default name.

Constant Summary collapse

MSG =
'Migration files should not use default name.'

Instance Method Summary collapse

Instance Method Details

#on_new_investigationObject



12
13
14
15
16
17
18
19
20
# File 'lib/rubocop/cop/sequel/migration_name.rb', line 12

def on_new_investigation
  file_path = processed_source.buffer.name
  return if config.file_to_include?(file_path)

  return unless filename_bad?(file_path)

  location = source_range(processed_source.buffer, 1, 0)
  add_offense(location)
end