diff options
Diffstat (limited to 'rubocop/cop/gitlab/mark_used_feature_flags.rb')
-rw-r--r-- | rubocop/cop/gitlab/mark_used_feature_flags.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rubocop/cop/gitlab/mark_used_feature_flags.rb b/rubocop/cop/gitlab/mark_used_feature_flags.rb index 03ee4805f4e..d3c5cfb827e 100644 --- a/rubocop/cop/gitlab/mark_used_feature_flags.rb +++ b/rubocop/cop/gitlab/mark_used_feature_flags.rb @@ -255,10 +255,17 @@ module RuboCop ] # For EE additionally process `ee/` feature flags - if File.exist?(File.expand_path('../../../ee/app/models/license.rb', __dir__)) && !%w[true 1].include?(ENV['FOSS_ONLY'].to_s) + 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 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 + flags_paths << 'jh/config/feature_flags/**/*.yml' + end + flags_paths.each_with_object([]) do |flags_path, memo| flags_path = File.expand_path("../../../#{flags_path}", __dir__) Dir.glob(flags_path).each do |path| |