From 5c6bd9b00925abdbae16a5478add295831f7a8d8 Mon Sep 17 00:00:00 2001 From: Vitali Tatarintev Date: Mon, 28 Mar 2022 11:12:39 +0200 Subject: [PATCH 1/2] Move Style/SpecialGlobalVars into separate TODO file --- .rubocop_todo.yml | 7 --- .rubocop_todo/style/special_global_vars.yml | 60 +++++++++++++++++++++ 2 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 .rubocop_todo/style/special_global_vars.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2dc699257107f3..c27291f8f5381f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -603,13 +603,6 @@ Style/SingleArgumentDig: Style/SoleNestedConditional: Enabled: false -# Offense count: 120 -# Cop supports --auto-correct. -# Configuration parameters: . -# SupportedStyles: use_perl_names, use_english_names -Style/SpecialGlobalVars: - EnforcedStyle: use_perl_names - # Offense count: 562 # Cop supports --auto-correct. Style/StringConcatenation: diff --git a/.rubocop_todo/style/special_global_vars.yml b/.rubocop_todo/style/special_global_vars.yml new file mode 100644 index 00000000000000..559d8169f9fba7 --- /dev/null +++ b/.rubocop_todo/style/special_global_vars.yml @@ -0,0 +1,60 @@ +--- +# Cop supports --auto-correct. +Style/SpecialGlobalVars: + Exclude: + - 'app/controllers/help_controller.rb' + - 'app/models/application_setting_implementation.rb' + - 'app/services/prometheus/proxy_variable_substitution_service.rb' + - 'ee/bin/geo_log_cursor' + - 'ee/lib/ee/banzai/filter/references/epic_reference_filter.rb' + - 'ee/lib/ee/banzai/filter/references/iteration_reference_filter.rb' + - 'ee/lib/ee/banzai/filter/references/vulnerability_reference_filter.rb' + - 'lib/backup/database.rb' + - 'lib/banzai/filter/blockquote_fence_filter.rb' + - 'lib/banzai/filter/commit_trailers_filter.rb' + - 'lib/banzai/filter/front_matter_filter.rb' + - 'lib/banzai/filter/inline_metrics_redactor_filter.rb' + - 'lib/banzai/filter/references/abstract_reference_filter.rb' + - 'lib/banzai/filter/references/commit_range_reference_filter.rb' + - 'lib/banzai/filter/references/commit_reference_filter.rb' + - 'lib/banzai/filter/references/external_issue_reference_filter.rb' + - 'lib/banzai/filter/references/label_reference_filter.rb' + - 'lib/banzai/filter/references/milestone_reference_filter.rb' + - 'lib/banzai/filter/references/project_reference_filter.rb' + - 'lib/banzai/filter/references/reference_cache.rb' + - 'lib/banzai/filter/references/user_reference_filter.rb' + - 'lib/banzai/filter/sanitization_filter.rb' + - 'lib/extracts_ref.rb' + - 'lib/gitlab/dependency_linker/godeps_json_linker.rb' + - 'lib/gitlab/gfm/uploads_rewriter.rb' + - 'lib/gitlab/git/gitmodules_parser.rb' + - 'lib/gitlab/graphql/queries.rb' + - 'lib/gitlab/hook_data/base_builder.rb' + - 'lib/gitlab/log_timestamp_formatter.rb' + - 'lib/gitlab/puma_logging/json_formatter.rb' + - 'lib/gitlab/quick_actions/extractor.rb' + - 'lib/gitlab/runtime.rb' + - 'lib/gitlab/string_placeholder_replacer.rb' + - 'lib/prometheus/pid_provider.rb' + - 'lib/tasks/lint.rake' + - 'qa/chemlab-library-gitlab.gemspec' + - 'qa/qa/git/repository.rb' + - 'qa/qa/service/cluster_provider/gcloud.rb' + - 'qa/qa/support/wait_for_requests.rb' + - 'scripts/api/cancel_pipeline.rb' + - 'scripts/api/download_job_artifact.rb' + - 'scripts/api/get_job_id.rb' + - 'scripts/changed-feature-flags' + - 'scripts/failed_tests.rb' + - 'scripts/perf/query_limiting_report.rb' + - 'scripts/pipeline_test_report_builder.rb' + - 'scripts/rubocop-max-files-in-cache-check' + - 'scripts/setup/find-jh-branch.rb' + - 'scripts/static-analysis' + - 'scripts/trigger-build.rb' + - 'spec/fast_spec_helper.rb' + - 'spec/rack_servers/puma_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/support/generate-seed-repo-rb' + - 'spec/support/helpers/test_env.rb' + - 'spec/support/prepare-gitlab-git-test-for-commit' -- GitLab From 70a9cd70caf61af29756843a45930b8482192631 Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Tue, 29 Mar 2022 13:25:17 +0200 Subject: [PATCH 2/2] Remove code comment related to a RuboCop weird behaviour See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/83725 --- spec/fast_spec_helper.rb | 1 - spec/spec_helper.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/spec/fast_spec_helper.rb b/spec/fast_spec_helper.rb index ce3c9af22f1718..6cbe97fb3f3ad4 100644 --- a/spec/fast_spec_helper.rb +++ b/spec/fast_spec_helper.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -# $" is $LOADED_FEATURES, but RuboCop didn't like it if $".include?(File.expand_path('spec_helper.rb', __dir__)) # There's no need to load anything here if spec_helper is already loaded # because spec_helper is more extensive than fast_spec_helper diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 86a7c079ea9cd0..e9f2da930168c8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -# $" is $LOADED_FEATURES, but RuboCop didn't like it if $".include?(File.expand_path('fast_spec_helper.rb', __dir__)) warn 'Detected fast_spec_helper is loaded first than spec_helper.' warn 'If running test files using both spec_helper and fast_spec_helper,' -- GitLab