Class: NdrDevSupport::RakeCI::CommitCop::MigrationWithoutStructureDump

Inherits:
Object
  • Object
show all
Includes:
Deputisable
Defined in:
lib/ndr_dev_support/rake_ci/commit_cop/migration_without_structure_dump.rb

Overview

This cop checks for new migrations with no accompanying structure dump

Instance Method Summary collapse

Instance Method Details

#check(changes) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/ndr_dev_support/rake_ci/commit_cop/migration_without_structure_dump.rb', line 10

def check(changes)
  return unless changes[:added].any?(&unscoped_migration_file?) &&
                changes[:modified].none?(&structure_dump_file?)

  attachment(:danger,
             'No structure file committed',
             'Migration(s) were added with no accompanying structure file(s)')
end