Sha256: 6af758e76947061d78cf8496f001b17c86aa496aaf9cb078169aa2f7f5cd44ae

Contents?: true

Size: 662 Bytes

Versions: 58

Compression:

Stored size: 662 Bytes

Contents

require_relative 'concerns/deputisable'

module NdrDevSupport
  module RakeCI
    module CommitCop
      # This cop checks for renamed migrations that change timestamp
      class RenamedMigration
        include Deputisable

        def check(changes)
          renamed_migrations = changes[:renamed].select(&migration_file?)
          return if renamed_migrations.all? do |old_file, new_file|
            File.basename(old_file)[0, 14] == File.basename(new_file)[0, 14]
          end

          attachment(:danger,
                     'Renamed Migration',
                     'Migrations should not change timestamp')
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
ndr_dev_support-6.1.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-6.0.4 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-6.0.3 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-6.0.2 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-6.0.1 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-6.0.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.10.2 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.10.1 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.10.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.9.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.8.2 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.8.1 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.8.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.7.1 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.7.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.6.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.5.0 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.4.8 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.4.7 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb
ndr_dev_support-5.4.6 lib/ndr_dev_support/rake_ci/commit_cop/renamed_migration.rb