Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rubocop/migration_helpers.rb')
-rw-r--r--rubocop/migration_helpers.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/rubocop/migration_helpers.rb b/rubocop/migration_helpers.rb
index 63b3766e126..f14f4d33709 100644
--- a/rubocop/migration_helpers.rb
+++ b/rubocop/migration_helpers.rb
@@ -32,6 +32,11 @@ module RuboCop
in_deployment_migration?(node) || in_post_deployment_migration?(node)
end
+ def in_background_migration?(node)
+ filepath(node).include?('/lib/gitlab/background_migration/') ||
+ filepath(node).include?('/ee/lib/ee/gitlab/background_migration/')
+ end
+
def in_deployment_migration?(node)
dirname(node).end_with?('db/migrate', 'db/geo/migrate')
end
@@ -56,8 +61,12 @@ module RuboCop
private
+ def filepath(node)
+ node.location.expression.source_buffer.name
+ end
+
def dirname(node)
- File.dirname(node.location.expression.source_buffer.name)
+ File.dirname(filepath(node))
end
def rubocop_migrations_config