summaryrefslogtreecommitdiff
path: root/rubocop
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-02 18:11:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-02 18:11:52 +0000
commitd1ade10ba69cb7c232daa36625656456c32462e4 (patch)
tree70597a997a68fc63b009001480247794a60e2dd6 /rubocop
parent3a52eefc27143af8a2b3838a159c52484ca4bc8b (diff)
downloadgitlab-ce-d1ade10ba69cb7c232daa36625656456c32462e4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r--rubocop/code_reuse_helpers.rb8
-rw-r--r--rubocop/cop/gitlab/mark_used_feature_flags.rb6
2 files changed, 10 insertions, 4 deletions
diff --git a/rubocop/code_reuse_helpers.rb b/rubocop/code_reuse_helpers.rb
index 283c43de227..6ea12999cae 100644
--- a/rubocop/code_reuse_helpers.rb
+++ b/rubocop/code_reuse_helpers.rb
@@ -180,5 +180,13 @@ module RuboCop
def rails_root
File.expand_path('..', __dir__)
end
+
+ def ee?
+ File.exist?(File.expand_path('../ee/app/models/license.rb', __dir__)) && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s)
+ end
+
+ def jh?
+ ee? && Dir.exist?(File.expand_path('../jh', __dir__)) && !%w[true 1].include?(ENV['EE_ONLY'].to_s)
+ end
end
end
diff --git a/rubocop/cop/gitlab/mark_used_feature_flags.rb b/rubocop/cop/gitlab/mark_used_feature_flags.rb
index d3c5cfb827e..4d9fc6148fa 100644
--- a/rubocop/cop/gitlab/mark_used_feature_flags.rb
+++ b/rubocop/cop/gitlab/mark_used_feature_flags.rb
@@ -255,14 +255,12 @@ module RuboCop
]
# For EE additionally process `ee/` feature flags
- is_ee = File.exist?(File.expand_path('../../../ee/app/models/license.rb', __dir__)) && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s)
- if is_ee
+ if ee?
flags_paths << 'ee/config/feature_flags/**/*.yml'
end
# For JH additionally process `jh/` feature flags
- is_jh = is_ee && Dir.exist?(File.expand_path('../../../jh', __dir__)) && !%w[true 1].include?(ENV['EE_ONLY'].to_s)
- if is_jh
+ if jh?
flags_paths << 'jh/config/feature_flags/**/*.yml'
end