diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-15 15:09:29 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-15 15:09:29 +0000 |
| commit | 16cdacff02fbf0069182e090df2eeaa754007957 (patch) | |
| tree | 5d19a3022bb7266834dad55a757f53bd48dc44e5 /scripts | |
| parent | 37439afe69efe58e2351d899d231670d945be5e2 (diff) | |
| download | gitlab-ce-16cdacff02fbf0069182e090df2eeaa754007957.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/rubocop-max-files-in-cache-check | 28 | ||||
| -rwxr-xr-x | scripts/static-analysis | 1 |
2 files changed, 0 insertions, 29 deletions
diff --git a/scripts/rubocop-max-files-in-cache-check b/scripts/rubocop-max-files-in-cache-check deleted file mode 100755 index 34caa0e197c..00000000000 --- a/scripts/rubocop-max-files-in-cache-check +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative '../config/bundler_setup' -require 'rubocop' - -MINIMUM_MAX_FILES_IN_CACHE_MARGIN = 1.05 -RECOMMENDED_MAX_FILES_IN_CACHE_MARGIN = 1.25 -RUBOCOP_LIST_TARGET_FILES_COMMAND = 'bundle exec rubocop --list-target-files | wc -l' - -RuboCopMaxFilesInCacheIsTooSmall = Class.new(StandardError) - -rubocop_target_files_count = `#{RUBOCOP_LIST_TARGET_FILES_COMMAND}`.strip.to_i - -raise Error, "#{RUBOCOP_LIST_TARGET_FILES_COMMAND} failed with status #{$?}!" if rubocop_target_files_count == 0 - -rubocop_target_files_count = rubocop_target_files_count.to_i -rubocop_current_max_files_in_cache = RuboCop::ConfigLoader.load_yaml_configuration(File.expand_path('../.rubocop.yml', __dir__)).dig('AllCops', 'MaxFilesInCache').to_i -minimum_max_files_in_cache = (rubocop_target_files_count * MINIMUM_MAX_FILES_IN_CACHE_MARGIN).round(-3) - -# We want AllCops.MaxFilesInCache to be at least 5% above the actual files count at any time to give us enough time to increase it accordingly -if rubocop_current_max_files_in_cache <= minimum_max_files_in_cache - recommended_max_files_in_cache = (rubocop_target_files_count * RECOMMENDED_MAX_FILES_IN_CACHE_MARGIN).round(-3) - raise RuboCopMaxFilesInCacheIsTooSmall, "Current count of RuboCop target file is #{rubocop_target_files_count} but AllCops.MaxFilesInCache is set to #{rubocop_current_max_files_in_cache}. We recommend to increase it to #{recommended_max_files_in_cache}." -else - puts "Current count of RuboCop target file is #{rubocop_target_files_count} and AllCops.MaxFilesInCache is set to #{rubocop_current_max_files_in_cache}. All good." - exit(0) -end diff --git a/scripts/static-analysis b/scripts/static-analysis index a346675099a..9a0057d8f4d 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -50,7 +50,6 @@ class StaticAnalysis Task.new(%w[bin/rake gettext:lint], 105), Task.new(%W[scripts/license-check.sh #{project_path}], 200), Task.new(%w[bin/rake lint:static_verification], 40), - Task.new(%w[scripts/rubocop-max-files-in-cache-check], 25), Task.new(%w[bin/rake config_lint], 10), Task.new(%w[bin/rake gitlab:sidekiq:all_queues_yml:check], 15), (Gitlab.ee? ? Task.new(%w[bin/rake gitlab:sidekiq:sidekiq_queues_yml:check], 11) : nil), |
