Skip to content

RuboCop TODOs: Remove excludes for non-existent files

Peter Leitzen requested to merge pl-rubocop-removed-non-existing-excludes into master

What does this MR do and why?

This MR implements a new rake task rake rubocop:todo:remove_orphaned_excludes to remove orphaned excludes from RuboCop TODOs.

How to set up and validate locally

bundle exec rake rubocop:todo:remove_orphaned_excludes

$ git reset --hard HEAD~
$ bundle exec rake rubocop:todo:remove_orphaned_excludes
Metrics/AbcSize: 1 removals
Gitlab/NamespacedClass: 17 removals
Gitlab/FeatureAvailableUsage: 4 removals
Gitlab/ServiceResponse: 1 removals
Rails/IndexWith: 1 removals
Rails/TimeZone: 1 removals
Rails/Pluck: 2 removals
Rails/FilePath: 1 removals
Layout/LineLength: 57 removals
Layout/FirstHashElementIndentation: 19 removals
Layout/ArgumentAlignment: 4 removals
Layout/SpaceInLambdaLiteral: 3 removals
Layout/MultilineOperationIndentation: 1 removals
Performance/ActiveRecordSubtransactionMethods: 1 removals
Performance/MethodObjectAsBlock: 1 removals
Database/MultipleDatabases: 3 removals
Lint/ConstantDefinitionInBlock: 1 removals
Lint/MissingCopEnableDirective: 1 removals
Lint/RedundantCopDisableDirective: 2 removals
Migration/BackgroundMigrationBaseClass: 4 removals
Migration/BackgroundMigrationRecord: 4 removals
Cop/UserAdmin: 1 removals
Naming/HeredocDelimiterNaming: 1 removals
Style/IfUnlessModifier: 9 removals
Style/GuardClause: 6 removals
Style/RedundantSelf: 1 removals
Style/PercentLiteralDelimiters: 9 removals
Style/StringConcatenation: 4 removals
Style/RedundantInterpolation: 2 removals
Style/EmptyMethod: 1 removals
Style/ClassAndModuleChildren: 8 removals
Style/FormatString: 12 removals
Style/HashAsLastArrayItem: 3 removals
Style/SymbolProc: 3 removals
Style/RedundantRegexpEscape: 1 removals
RSpec/LeakyConstantDeclaration: 1 removals
RSpec/VerifiedDoubles: 20 removals
RSpec/InstanceVariable: 13 removals
RSpec/EmptyLineAfterHook: 3 removals
RSpec/HooksBeforeExamples: 3 removals
RSpec/FilePath: 1 removals
RSpec/ScatteredLet: 2 removals
RSpec/ContextWording: 69 removals
RSpec/ReturnFromStub: 2 removals
RSpec/DescribedClass: 4 removals
RSpec/AnyInstanceOf: 6 removals
RSpec/ExpectInHook: 15 removals

Total: 329 removals

$ git reset --hard @{u}

Removed excludes:

$ git show | rg -o -r '$1' "^-\s+- '?(\S+)'?"  | sort | uniq | wc -l
231
Click to expand
app/controllers/boards/issues_controller.rb'
app/controllers/boards/lists_controller.rb'
app/controllers/concerns/integrations/hooks_execution.rb'
app/controllers/projects/ci/secure_files_controller.rb'
app/controllers/projects/google_cloud_controller.rb'
app/controllers/projects/product_analytics_controller.rb'
app/controllers/projects/tags/releases_controller.rb'
app/graphql/mutations/work_items/update_widgets.rb'
app/graphql/resolvers/base_issues_resolver.rb'
app/graphql/resolvers/concerns/issue_resolver_arguments.rb'
app/models/concerns/approvable_base.rb'
app/models/experiment.rb'
app/models/experiment_subject.rb'
app/models/experiment_user.rb'
app/serializers/board_serializer.rb'
app/serializers/board_simple_entity.rb'
app/serializers/current_board_entity.rb'
app/serializers/current_board_serializer.rb'
app/services/clusters/applications/check_uninstall_progress_service.rb'
app/services/clusters/applications/patch_service.rb'
app/services/clusters/applications/prometheus_update_service.rb'
app/services/clusters/kubernetes/configure_istio_ingress_service.rb'
app/services/users/migrate_to_ghost_user_service.rb'
app/validators/branch_filter_validator.rb'
app/workers/archive_trace_worker.rb'
app/workers/build_finished_worker.rb'
config/initializers/active_record_data_types.rb'
ee/app/components/namespaces/free_user_cap/personable.rb'
ee/app/components/namespaces/free_user_cap/personal_alert_component.rb'
ee/app/components/namespaces/free_user_cap/personal_preview_alert_component.rb'
ee/app/components/namespaces/free_user_cap/personal_usage_quota_limitations_alert_component.rb'
ee/app/controllers/ee/boards/lists_controller.rb
ee/app/graphql/ee/resolvers/base_issues_resolver.rb'
ee/app/helpers/ee/groups/reporting_helper.rb'
ee/app/models/protected_environment/deploy_access_level.rb
ee/app/models/protected_environment/deploy_access_level.rb'
ee/app/serializers/board_assignee_entity.rb'
ee/app/serializers/board_label_entity.rb'
ee/app/serializers/board_milestone_entity.rb'
ee/app/services/audit_events/build_service.rb'
ee/app/services/ee/projects/update_pages_service.rb'
ee/app/services/ee/users/migrate_to_ghost_user_service.rb'
ee/app/services/security/findings/cleanup_service.rb'
ee/app/views/projects/issues/_related_issues.html.haml
ee/app/views/projects/_merge_request_approvals_settings.html.haml
ee/lib/ee/api/protected_branches.rb'
ee/lib/ee/audit/group_changes_auditor.rb'
ee/lib/ee/audit/project_changes_auditor.rb'
ee/lib/ee/audit/project_ci_cd_setting_changes_auditor.rb'
ee/lib/ee/audit/project_setting_changes_auditor.rb'
ee/lib/ee/gitlab/background_migration/populate_status_column_of_security_scans.rb
ee/lib/ee/gitlab/background_migration/populate_status_column_of_security_scans.rb'
ee/lib/ee/gitlab/uploads/migration_helper.rb'
ee/lib/gitlab/auth_logger.rb'
ee/lib/gitlab/ci/parsers/security/formatters/dast.rb'
ee/lib/gitlab/ci/pipeline/chain/config/content/compliance.rb
ee/lib/gitlab/pagination_delegate.rb'
ee/spec/components/namespaces/free_user_cap/personal_usage_quota_limitations_alert_component_spec.rb'
ee/spec/controllers/boards/issues_controller_spec.rb
ee/spec/controllers/boards/issues_controller_spec.rb'
ee/spec/controllers/boards/lists_controller_spec.rb'
ee/spec/controllers/boards/users_controller_spec.rb'
ee/spec/features/groups/iterations/iterations_list_spec.rb'
ee/spec/features/groups/iteration_spec.rb'
ee/spec/features/ide/user_commits_changes_spec.rb'
ee/spec/features/projects/iterations/iterations_list_spec.rb'
ee/spec/features/registrations/saas_user_registration_spec.rb'
ee/spec/features/registrations/trial_during_signup_flow_spec.rb'
ee/spec/lib/ee/audit/compliance_framework_changes_auditor_spec.rb'
ee/spec/lib/ee/audit/protected_branches_changes_auditor_spec.rb'
ee/spec/lib/ee/gitlab/ci/pipeline/quota/job_activity_spec.rb
ee/spec/lib/ee/gitlab/ci/pipeline/quota/job_activity_spec.rb'
ee/spec/lib/gitlab/audit/target_spec.rb
ee/spec/lib/gitlab/ci/parsers/security/formatters/dast_spec.rb'
ee/spec/lib/gitlab/ci/templates/sast_iac_latest_gitlab_ci_yaml_spec.rb'
ee/spec/lib/gitlab/pagination_delegate_spec.rb'
ee/spec/models/protected_environments/approval_summary_spec.rb'
ee/spec/serializers/board_serializer_spec.rb'
ee/spec/services/arkose/user_verification_service_spec.rb'
ee/spec/services/ci/create_pipeline_service/limit_active_jobs_spec.rb'
ee/spec/services/ee/issues/close_service_spec.rb'
ee/spec/services/ee/issues/reopen_service_spec.rb'
ee/spec/services/ee/users/migrate_to_ghost_user_service_spec.rb'
ee/spec/services/gitlab_subscriptions/activate_awaiting_users_service_spec.rb'
ee/spec/services/gitlab_subscriptions/apply_trial_service_spec.rb'
ee/spec/services/namespaces/free_user_cap/deactivate_members_over_limit_service_spec.rb'
ee/spec/services/namespaces/free_user_cap/remove_group_group_links_outside_hierarchy_service_spec.rb'
ee/spec/services/projects/update_pages_service_spec.rb
ee/spec/services/requirements_management/update_requirement_service_spec.rb'
ee/spec/services/security/findings/cleanup_service_spec.rb'
ee/spec/support/factory_bot.rb'
ee/spec/support/shared_examples/services/alert_management/alert_processing/oncall_notifications_shared_examples.rb
ee/spec/views/shared/credentials_inventory/project_access_tokens/_project_access_token.html.haml_spec.rb'
lib/api/version.rb'
lib/gitlab/background_migration/backfill_ci_namespace_mirrors.rb
lib/gitlab/background_migration/backfill_ci_namespace_mirrors.rb'
lib/gitlab/background_migration/backfill_ci_project_mirrors.rb
lib/gitlab/background_migration/backfill_ci_project_mirrors.rb'
lib/gitlab/background_migration/backfill_projects_with_coverage.rb
lib/gitlab/background_migration/backfill_projects_with_coverage.rb'
lib/gitlab/background_migration/populate_status_column_of_security_scans.rb'
lib/gitlab/batch_pop_queueing.rb'
lib/gitlab/ci/pipeline/seed/environment.rb'
lib/gitlab/experimentation/controller_concern.rb'
lib/gitlab/experimentation_logger.rb'
lib/gitlab/experimentation.rb'
lib/gitlab/gitaly_client/wiki_service.rb'
lib/gitlab/git/wiki.rb'
lib/gitlab/graphql/pagination/keyset/last_items.rb'
lib/gitlab/usage/metrics/names_suggestions/relation_parsers/constraints.rb'
qa/qa/scenario/test/instance.rb'
qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb
qa/qa/specs/features/api/3_create/gitaly/automatic_failover_and_recovery_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/backend_node_recovery_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/distributed_reads_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/gitaly_mtls_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/praefect_connectivity_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/praefect_dataloss_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/praefect_replication_queue_spec.rb'
qa/qa/specs/features/api/3_create/gitaly/praefect_repo_sync_spec.rb'
qa/qa/specs/features/api/3_create/integrations/webhook_events_spec.rb'
qa/qa/specs/features/browser_ui/1_manage/project/protected_tags_spec.rb
qa/qa/specs/features/browser_ui/1_manage/user/user_access_termination_spec.rb'
qa/qa/specs/features/browser_ui/3_create/jenkins/jenkins_build_status_spec.rb'
qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb'
qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb'
qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_creation_spec.rb'
qa/qa/specs/features/browser_ui/3_create/wiki/project_based_content_manipulation_spec.rb'
qa/qa/specs/features/browser_ui/3_create/wiki/project_based_directory_management_spec.rb'
qa/qa/specs/features/browser_ui/3_create/wiki/project_based_list_spec.rb'
qa/qa/specs/features/browser_ui/3_create/wiki/project_based_page_deletion_spec.rb'
qa/qa/specs/features/browser_ui/7_configure/kubernetes/kubernetes_integration_spec.rb'
qa/qa/specs/features/ee/browser_ui/10_protect/policies_list_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/attachment_replication_spec.rb
qa/qa/specs/features/ee/browser_ui/12_geo/geo_replication_ci_job_log_artifacts_spec.rb
qa/qa/specs/features/ee/browser_ui/12_geo/http_push_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/http_push_to_secondary_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/rename_replication_spec.rb
qa/qa/specs/features/ee/browser_ui/12_geo/ssh_push_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/ssh_push_to_secondary_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/wiki_http_push_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/wiki_http_push_to_secondary_spec.rb'
qa/qa/specs/features/ee/browser_ui/12_geo/wiki_ssh_push_spec.rb'
qa/qa/specs/features/ee/browser_ui/13_secure/create_merge_request_with_secure_spec.rb
qa/qa/specs/features/ee/browser_ui/13_secure/create_merge_request_with_secure_spec.rb'
qa/qa/specs/features/ee/browser_ui/13_secure/project_security_dashboard_spec.rb
qa/qa/specs/features/ee/browser_ui/13_secure/scan_result_policy_vulnerabilities_spec.rb'
qa/qa/specs/features/ee/browser_ui/13_secure/security_reports_spec.rb
qa/qa/specs/features/ee/browser_ui/13_secure/security_reports_spec.rb'
qa/qa/specs/features/ee/browser_ui/13_secure/vulnerability_management_spec.rb
qa/qa/specs/features/ee/browser_ui/13_secure/vulnerability_management_spec.rb'
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_audit_logs_1_spec.rb
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_audit_logs_1_spec.rb'
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_audit_logs_2_spec.rb'
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_file_template_spec.rb
qa/qa/specs/features/ee/browser_ui/1_manage/insights/default_insights_spec.rb'
qa/qa/specs/features/ee/browser_ui/1_manage/instance/instance_audit_logs_spec.rb'
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_audit_logs_spec.rb'
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb
qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb'
qa/qa/specs/features/ee/browser_ui/2_plan/integrations/jira_issues_list_spec.rb
qa/qa/specs/features/ee/browser_ui/3_create/wiki/create_group_wiki_page_spec.rb'
qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_status_on_operation_dashboard_spec.rb'
qa/qa/specs/features/ee/browser_ui/9_enablement/elasticsearch/elasticsearch_reindexing_spec.rb'
qa/spec/scenario/test/integration/github_spec.rb
qa/spec/support/formatters/test_stats_formatter_spec.rb'
spec/config/metrics/aggregates/aggregated_metrics_spec.rb'
spec/controllers/boards/issues_controller_spec.rb
spec/controllers/boards/issues_controller_spec.rb'
spec/controllers/boards/lists_controller_spec.rb
spec/controllers/boards/lists_controller_spec.rb'
spec/controllers/projects/ci/secure_files_controller_spec.rb'
spec/controllers/projects/product_analytics_controller_spec.rb'
spec/finders/merge_requests_finder/params_spec.rb'
spec/graphql/features/feature_flag_spec.rb
spec/graphql/features/feature_flag_spec.rb'
spec/lib/api/entities/personal_access_token_with_details_spec.rb'
spec/lib/gitlab/batch_pop_queueing_spec.rb'
spec/lib/gitlab/ci/pipeline/seed/deployment_spec.rb'
spec/lib/gitlab/ci/pipeline/seed/environment_spec.rb'
spec/lib/gitlab/experimentation/controller_concern_spec.rb
spec/lib/gitlab/experimentation/controller_concern_spec.rb'
spec/lib/gitlab/experimentation/experiment_spec.rb
spec/lib/gitlab/experimentation_spec.rb
spec/lib/gitlab/experimentation_spec.rb'
spec/lib/gitlab/gitaly_client/wiki_service_spec.rb
spec/lib/gitlab/gitaly_client/wiki_service_spec.rb'
spec/lib/gitlab/git/cross_repo_comparer_spec.rb'
spec/lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition_spec.rb
spec/lib/gitlab/graphql/pagination/keyset/conditions/null_condition_spec.rb
spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb
spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb
spec/lib/gitlab/usage/metrics/names_suggestions/relation_parsers/constraints_spec.rb'
spec/models/concerns/cascading_namespace_setting_attribute_spec.rb'
spec/models/experiment_spec.rb'
spec/requests/api/graphql/mutations/merge_requests/request_attention_spec.rb'
spec/requests/api/graphql/mutations/remove_attention_request_spec.rb'
spec/requests/api/graphql/mutations/work_items/update_widgets_spec.rb'
spec/requests/api/version_spec.rb'
spec/requests/product_analytics/collector_app_attack_spec.rb'
spec/requests/product_analytics/collector_app_spec.rb'
spec/serializers/board_serializer_spec.rb'
spec/services/clusters/applications/check_ingress_ip_address_service_spec.rb
spec/services/clusters/applications/check_ingress_ip_address_service_spec.rb'
spec/services/clusters/applications/check_installation_progress_service_spec.rb
spec/services/clusters/applications/check_installation_progress_service_spec.rb'
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb'
spec/services/clusters/applications/create_service_spec.rb
spec/services/clusters/applications/create_service_spec.rb'
spec/services/clusters/applications/destroy_service_spec.rb'
spec/services/clusters/applications/patch_service_spec.rb'
spec/services/clusters/applications/prometheus_update_service_spec.rb
spec/services/clusters/applications/prometheus_update_service_spec.rb'
spec/services/clusters/applications/uninstall_service_spec.rb'
spec/services/clusters/applications/update_service_spec.rb
spec/services/clusters/applications/update_service_spec.rb'
spec/services/clusters/kubernetes/configure_istio_ingress_service_spec.rb'
spec/services/merge_requests/bulk_remove_attention_requested_service_spec.rb'
spec/services/merge_requests/toggle_attention_requested_service_spec.rb
spec/services/merge_requests/toggle_attention_requested_service_spec.rb'
spec/services/users/migrate_to_ghost_user_service_spec.rb
spec/services/users/migrate_to_ghost_user_service_spec.rb'
spec/support/database/multiple_databases.rb'
spec/support_specs/database/multiple_databases_spec.rb'
spec/views/projects/artifacts/_artifact.html.haml_spec.rb
spec/views/projects/artifacts/_artifact.html.haml_spec.rb'
spec/workers/archive_trace_worker_spec.rb
spec/workers/build_finished_worker_spec.rb'
spec/workers/cluster_configure_istio_worker_spec.rb
spec/workers/cluster_update_app_worker_spec.rb'
spec/workers/cluster_wait_for_app_update_worker_spec.rb'

Verify that the removed entries no longer exist via:

git show | rg -o -r '$1' "^-\s+- (\S+)" | xargs -I% stat % 2>/dev/null
# no output because all `stat` calls failed with an error and not output to stdout

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports