From fa352bf4dd69ca64dcae80ca2f680605708a7ca4 Mon Sep 17 00:00:00 2001 From: Abdul Wadood <awadood@gitlab.com> Date: Tue, 5 Nov 2024 13:39:34 +0530 Subject: [PATCH] Fix all Lint/RedundantCopDisableDirective offenses We'll enable this cop after fixing all the offenses. --- .rubocop.yml | 10 ++-- .rubocop_todo/layout/line_length.yml | 20 +++++++ .../lint/redundant_cop_disable_directive.yml | 53 +------------------ .../groups/milestones_controller.rb | 2 +- .../work_items/widgets/development_type.rb | 2 +- .../concerns/integrations/base/integration.rb | 2 +- app/models/work_items/type.rb | 2 +- app/policies/issue_policy.rb | 2 - .../set_runner_associated_projects_service.rb | 2 +- .../work_items/data_sync/clone_service.rb | 2 +- .../work_items/data_sync/move_service.rb | 2 +- ...021082113_create_partitioned_ci_runners.rb | 2 - ...6_create_partitioned_ci_runner_managers.rb | 2 - ...163518_drop_user_canonical_emails_table.rb | 2 +- .../ee/projects/settings/ci_cd_controller.rb | 2 +- .../ee/audit_events/project_audit_event.rb | 2 +- .../services/search/zoekt/routing_service.rb | 3 +- .../statistics/adjustment_service.rb | 2 - ...fication_to_merge_request_diff_registry.rb | 2 +- ...sing_external_links_for_vulnerabilities.rb | 3 +- .../resolve_vulnerability/helpers.rb | 3 -- .../settings/domain_verification_spec.rb | 2 +- ee/spec/features/projects/mirror_spec.rb | 2 +- ...terations_cadence_reference_filter_spec.rb | 2 +- ...external_links_for_vulnerabilities_spec.rb | 5 +- ee/spec/lib/gitlab/elastic/client_spec.rb | 3 +- .../count_secure_pipelines_metric_spec.rb | 4 +- .../count_security_scans_metric_spec.rb | 4 +- ...te_from_vulnerability_data_service_spec.rb | 2 - ...oard_saml_reauth_banner_shared_examples.rb | 4 +- .../views/admin/users/show.html.haml_spec.rb | 4 +- lib/api/submodules.rb | 2 +- .../backfill_security_policies.rb | 2 +- ...ot_user_details_bot_namespace_migration.rb | 2 - lib/gitlab/popen/runner.rb | 2 +- qa/qa/resource/user_runners.rb | 2 +- qa/qa/service/docker_run/gitlab_runner.rb | 4 +- qa/qa/vendor/one_password/cli.rb | 2 +- .../pajamas/banner_component_preview.rb | 2 +- .../groups/participants_autocomplete_spec.rb | 2 +- .../merge_request/user_edits_mr_spec.rb | 2 +- .../secret/pbkdf2_sha512_spec.rb | 4 +- .../token/pbkdf2_sha512_spec.rb | 2 +- .../merge_requests/message_generator_spec.rb | 2 +- .../lib/gitlab/search/abuse_detection_spec.rb | 2 +- ...between_ci_builds_and_ci_pipelines_spec.rb | 2 +- .../concerns/encrypted_user_password_spec.rb | 5 +- .../api/alert_management_alerts_spec.rb | 8 ++- .../projects/releases_controller_spec.rb | 2 +- spec/scripts/setup/tests-metadata_spec.rb | 2 +- .../ci/create_pipeline_service/logger_spec.rb | 3 +- .../conan/create_package_service_spec.rb | 3 -- .../pypi/create_package_service_spec.rb | 7 +-- .../create_acme_order_service_spec.rb | 2 +- .../vulnerabilities_findings_helper.rb | 2 +- spec/support/helpers/wait_for_requests.rb | 5 +- .../milestone_editing_shared_examples.rb | 2 +- .../protected_ref_access_shared_examples.rb | 2 +- tooling/danger/sidekiq_queues.rb | 2 +- tooling/danger/stable_branch.rb | 2 +- 60 files changed, 101 insertions(+), 134 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index d814e41156bfc..9171c586b9c62 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -67,6 +67,13 @@ Rails/Date: # See https://gitlab.com/gitlab-org/gitlab/-/issues/502580 - danger/database/Dangerfile +Rails/Pluck: + Exclude: + # See https://gitlab.com/gitlab-org/gitlab/-/issues/502580 + - 'tooling/danger/**/*' + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94047#note_1179689274 + AutoCorrect: false + RSpec: Language: Includes: @@ -363,9 +370,6 @@ Rails/MailerName: # See for the context on why it's excluded https://gitlab.com/gitlab-org/gitlab/-/issues/239356#note_956419227 - 'app/mailers/notify.rb' -Rails/Pluck: - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94047#note_1179689274 - AutoCorrect: false Rails/RakeEnvironment: # Context on why it's disabled: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93419#note_1048223982 diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index bd6600e325efe..a1e8a5c2f7672 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -17,6 +17,7 @@ Layout/LineLength: - 'app/controllers/concerns/issuable_collections.rb' - 'app/controllers/concerns/membership_actions.rb' - 'app/controllers/concerns/notes_actions.rb' + - 'app/controllers/groups/milestones_controller.rb' - 'app/controllers/groups_controller.rb' - 'app/controllers/import/base_controller.rb' - 'app/controllers/import/bitbucket_controller.rb' @@ -1078,6 +1079,7 @@ Layout/LineLength: - 'ee/spec/features/groups/saml_providers_spec.rb' - 'ee/spec/features/groups/scim_token_spec.rb' - 'ee/spec/features/groups/security/compliance_dashboards_spec.rb' + - 'ee/spec/features/groups/settings/domain_verification_spec.rb' - 'ee/spec/features/integrations/jira/jira_issues_list_spec.rb' - 'ee/spec/features/issues/filtered_search/filter_issues_weight_spec.rb' - 'ee/spec/features/labels_hierarchy_spec.rb' @@ -1099,6 +1101,7 @@ Layout/LineLength: - 'ee/spec/features/projects/iterations/user_views_iteration_spec.rb' - 'ee/spec/features/projects/members/member_is_removed_from_project_spec.rb' - 'ee/spec/features/projects/members/member_leaves_project_spec.rb' + - 'ee/spec/features/projects/mirror_spec.rb' - 'ee/spec/features/projects/new_project_spec.rb' - 'ee/spec/features/projects/pipelines/pipeline_spec.rb' - 'ee/spec/features/projects/quality/test_case_list_spec.rb' @@ -1254,6 +1257,7 @@ Layout/LineLength: - 'ee/spec/lib/audit/details_spec.rb' - 'ee/spec/lib/banzai/filter/jira_private_image_link_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/epic_reference_filter_spec.rb' + - 'ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/label_reference_filter_spec.rb' - 'ee/spec/lib/banzai/filter/references/vulnerability_reference_filters_spec.rb' - 'ee/spec/lib/bulk_imports/projects/pipelines/issues_pipeline_spec.rb' @@ -1390,6 +1394,7 @@ Layout/LineLength: - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_event_streaming_destinations_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_groups_with_event_streaming_destinations_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_projects_with_external_status_checks_metric_spec.rb' + - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_users_associating_group_milestones_to_releases_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_users_creating_ci_builds_metric_spec.rb' - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/license_metric_spec.rb' @@ -1894,6 +1899,7 @@ Layout/LineLength: - 'ee/spec/support/shared_contexts/status_page/status_page_list_objects.rb' - 'ee/spec/support/shared_examples/controllers/analytics/cycle_analytics/shared_stage_shared_examples.rb' - 'ee/spec/support/shared_examples/controllers/concerns/description_diff_actions_shared_examples.rb' + - 'ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb' - 'ee/spec/support/shared_examples/features/epics_filtered_search_shared_examples.rb' - 'ee/spec/support/shared_examples/features/sidebar_shared_examples.rb' - 'ee/spec/support/shared_examples/finders/geo/registry_finder_shared_examples.rb' @@ -2069,6 +2075,7 @@ Layout/LineLength: - 'lib/api/settings.rb' - 'lib/api/snippet_repository_storage_moves.rb' - 'lib/api/snippets.rb' + - 'lib/api/submodules.rb' - 'lib/api/suggestions.rb' - 'lib/api/tags.rb' - 'lib/api/templates.rb' @@ -2430,6 +2437,7 @@ Layout/LineLength: - 'qa/qa/resource/registry_repository.rb' - 'qa/qa/resource/repository/push.rb' - 'qa/qa/resource/snippet.rb' + - 'qa/qa/resource/user_runners.rb' - 'qa/qa/resource/wiki/group_page.rb' - 'qa/qa/runtime/api/repository_storage_moves.rb' - 'qa/qa/runtime/env.rb' @@ -2438,6 +2446,7 @@ Layout/LineLength: - 'qa/qa/scenario/bootable.rb' - 'qa/qa/service/cluster_provider/gcloud.rb' - 'qa/qa/service/cluster_provider/k3s.rb' + - 'qa/qa/service/docker_run/gitlab_runner.rb' - 'qa/qa/service/praefect_manager.rb' - 'qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb' - 'qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb' @@ -2519,6 +2528,7 @@ Layout/LineLength: - 'qa/qa/tools/delete_test_users.rb' - 'qa/qa/tools/generate_perf_testdata.rb' - 'qa/qa/tools/initialize_gitlab_auth.rb' + - 'qa/qa/vendor/one_password/cli.rb' - 'qa/spec/git/repository_spec.rb' - 'qa/spec/resource/api_fabricator_spec.rb' - 'qa/spec/runtime/env_spec.rb' @@ -2702,6 +2712,7 @@ Layout/LineLength: - 'spec/features/groups/milestone_spec.rb' - 'spec/features/groups/milestones_sorting_spec.rb' - 'spec/features/groups/packages_spec.rb' + - 'spec/features/groups/participants_autocomplete_spec.rb' - 'spec/features/groups/settings/access_tokens_spec.rb' - 'spec/features/groups/settings/repository_spec.rb' - 'spec/features/groups_spec.rb' @@ -2738,6 +2749,7 @@ Layout/LineLength: - 'spec/features/merge_request/user_comments_on_diff_spec.rb' - 'spec/features/merge_request/user_creates_image_diff_notes_spec.rb' - 'spec/features/merge_request/user_creates_merge_request_spec.rb' + - 'spec/features/merge_request/user_edits_mr_spec.rb' - 'spec/features/merge_request/user_expands_diff_spec.rb' - 'spec/features/merge_request/user_interacts_with_batched_mr_diffs_spec.rb' - 'spec/features/merge_request/user_posts_diff_notes_spec.rb' @@ -3264,6 +3276,8 @@ Layout/LineLength: - 'spec/lib/gitlab/diff/inline_diff_marker_spec.rb' - 'spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb' - 'spec/lib/gitlab/diff/suggestion_spec.rb' + - 'spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb' + - 'spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb' - 'spec/lib/gitlab/email/failure_handler_spec.rb' - 'spec/lib/gitlab/email/handler/create_issue_handler_spec.rb' - 'spec/lib/gitlab/email/handler/create_merge_request_handler_spec.rb' @@ -3365,6 +3379,7 @@ Layout/LineLength: - 'spec/lib/gitlab/legacy_github_import/pull_request_formatter_spec.rb' - 'spec/lib/gitlab/lfs/client_spec.rb' - 'spec/lib/gitlab/mail_room/authenticator_spec.rb' + - 'spec/lib/gitlab/merge_requests/message_generator_spec.rb' - 'spec/lib/gitlab/metrics/background_transaction_spec.rb' - 'spec/lib/gitlab/metrics/boot_time_tracker_spec.rb' - 'spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb' @@ -3410,6 +3425,7 @@ Layout/LineLength: - 'spec/lib/gitlab/route_map_spec.rb' - 'spec/lib/gitlab/sanitizers/exif_spec.rb' - 'spec/lib/gitlab/sanitizers/svg_spec.rb' + - 'spec/lib/gitlab/search/abuse_detection_spec.rb' - 'spec/lib/gitlab/search/found_blob_spec.rb' - 'spec/lib/gitlab/search_results_spec.rb' - 'spec/lib/gitlab/serializer/pagination_spec.rb' @@ -3488,6 +3504,7 @@ Layout/LineLength: - 'spec/mailers/emails/service_desk_spec.rb' - 'spec/mailers/notify_spec.rb' - 'spec/migrations/active_record/schema_spec.rb' + - 'spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb' - 'spec/models/active_session_spec.rb' - 'spec/models/alert_management/alert_spec.rb' - 'spec/models/analytics/cycle_analytics/aggregation_spec.rb' @@ -3839,6 +3856,7 @@ Layout/LineLength: - 'spec/requests/projects/merge_requests/context_commit_diffs_spec.rb' - 'spec/requests/projects/merge_requests_discussions_spec.rb' - 'spec/requests/projects/merge_requests_spec.rb' + - 'spec/requests/projects/releases_controller_spec.rb' - 'spec/requests/projects/settings/access_tokens_controller_spec.rb' - 'spec/requests/projects/tags_controller_spec.rb' - 'spec/requests/projects_controller_spec.rb' @@ -4133,6 +4151,7 @@ Layout/LineLength: - 'spec/support/helpers/live_debugger.rb' - 'spec/support/helpers/login_helpers.rb' - 'spec/support/helpers/merge_request_diff_helpers.rb' + - 'spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb' - 'spec/support/helpers/prometheus_helpers.rb' - 'spec/support/helpers/seed_repo.rb' - 'spec/support/helpers/selection_helper.rb' @@ -4175,6 +4194,7 @@ Layout/LineLength: - 'spec/support/shared_examples/features/editable_merge_request_shared_examples.rb' - 'spec/support/shared_examples/features/error_tracking_shared_example.rb' - 'spec/support/shared_examples/features/manage_applications_shared_examples.rb' + - 'spec/support/shared_examples/features/milestone_editing_shared_examples.rb' - 'spec/support/shared_examples/features/page_description_shared_examples.rb' - 'spec/support/shared_examples/features/sidebar/sidebar_milestone_shared_examples.rb' - 'spec/support/shared_examples/features/wiki/user_views_asciidoc_page_with_includes_shared_examples.rb' diff --git a/.rubocop_todo/lint/redundant_cop_disable_directive.yml b/.rubocop_todo/lint/redundant_cop_disable_directive.yml index dddd82cc01e6c..1fb50dbba9742 100644 --- a/.rubocop_todo/lint/redundant_cop_disable_directive.yml +++ b/.rubocop_todo/lint/redundant_cop_disable_directive.yml @@ -1,56 +1,5 @@ --- # Cop supports --autocorrect. Lint/RedundantCopDisableDirective: - # Offense count: 62 - # Temporarily disabled due to too many offenses + # Temporarily disabled Enabled: false - Exclude: - - 'app/controllers/groups/milestones_controller.rb' - - 'app/models/concerns/integrations/base/integration.rb' - - 'app/models/work_items/type.rb' - - 'app/policies/issue_policy.rb' - - 'app/services/ci/runners/set_runner_associated_projects_service.rb' - - 'app/services/work_items/data_sync/clone_service.rb' - - 'app/services/work_items/data_sync/move_service.rb' - - 'db/migrate/20241021082113_create_partitioned_ci_runners.rb' - - 'db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb' - - 'db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb' - - 'ee/app/controllers/ee/projects/settings/ci_cd_controller.rb' - - 'ee/app/models/ee/audit_events/project_audit_event.rb' - - 'ee/app/services/search/zoekt/routing_service.rb' - - 'ee/app/services/vulnerabilities/statistics/adjustment_service.rb' - - 'ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb' - - 'ee/spec/features/groups/settings/domain_verification_spec.rb' - - 'ee/spec/features/projects/mirror_spec.rb' - - 'ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb' - - 'ee/spec/lib/gitlab/elastic/client_spec.rb' - - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb' - - 'ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb' - - 'ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb' - - 'ee/spec/views/admin/users/show.html.haml_spec.rb' - - 'lib/api/submodules.rb' - - 'lib/gitlab/popen/runner.rb' - - 'qa/qa/resource/user_runners.rb' - - 'qa/qa/service/docker_run/gitlab_runner.rb' - - 'qa/qa/vendor/one_password/cli.rb' - - 'spec/components/previews/pajamas/banner_component_preview.rb' - - 'spec/features/groups/participants_autocomplete_spec.rb' - - 'spec/features/merge_request/user_edits_mr_spec.rb' - - 'spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb' - - 'spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb' - - 'spec/lib/gitlab/merge_requests/message_generator_spec.rb' - - 'spec/lib/gitlab/search/abuse_detection_spec.rb' - - 'spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb' - - 'spec/models/concerns/encrypted_user_password_spec.rb' - - 'spec/requests/api/alert_management_alerts_spec.rb' - - 'spec/requests/projects/releases_controller_spec.rb' - - 'spec/scripts/setup/tests-metadata_spec.rb' - - 'spec/services/ci/create_pipeline_service/logger_spec.rb' - - 'spec/services/packages/pypi/create_package_service_spec.rb' - - 'spec/services/pages_domains/create_acme_order_service_spec.rb' - - 'spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb' - - 'spec/support/helpers/wait_for_requests.rb' - - 'spec/support/shared_examples/features/milestone_editing_shared_examples.rb' - - 'spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb' - - 'tooling/danger/sidekiq_queues.rb' - - 'tooling/danger/stable_branch.rb' diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 0c91631ab7b4d..9855ce4986436 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -70,7 +70,7 @@ def update render json: { errors: [ format( - _("Someone edited this %{model_name} at the same time you did. Please refresh your browser and make sure your changes will not unintentionally remove theirs."), # rubocop:disable Layout/LineLength + _("Someone edited this %{model_name} at the same time you did. Please refresh your browser and make sure your changes will not unintentionally remove theirs."), model_name: _('milestone') ) ] diff --git a/app/graphql/types/work_items/widgets/development_type.rb b/app/graphql/types/work_items/widgets/development_type.rb index d61045e621e92..a709289d05b90 100644 --- a/app/graphql/types/work_items/widgets/development_type.rb +++ b/app/graphql/types/work_items/widgets/development_type.rb @@ -16,7 +16,7 @@ class DevelopmentType < BaseObject Types::WorkItems::ClosingMergeRequestType.connection_type, null: true, description: 'Merge requests that will close the work item when merged.' - field :related_branches, # rubocop:disable GraphQL/ExtractType -- no need to extract to related + field :related_branches, Types::WorkItems::RelatedBranchType.connection_type, calls_gitaly: true, description: 'Branches that have referred to the work item, but do not have an associated merge request.', diff --git a/app/models/concerns/integrations/base/integration.rb b/app/models/concerns/integrations/base/integration.rb index dd6fd217ef3bc..4d7fe31c956b6 100644 --- a/app/models/concerns/integrations/base/integration.rb +++ b/app/models/concerns/integrations/base/integration.rb @@ -692,7 +692,7 @@ def event_names def api_field_names fields # rubocop:disable Style/NumberedParameters -- existing code moved as is - .reject { _1[:type] == :password || _1[:name] == 'webhook' || (_1.key?(:if) && _1[:if] != true) } # rubocop:disable Style/NumberedParameters -- existing code moved as is + .reject { _1[:type] == :password || _1[:name] == 'webhook' || (_1.key?(:if) && _1[:if] != true) } .pluck(:name) # rubocop:disable Database/AvoidUsingPluckWithoutLimit -- existing code moved as is end diff --git a/app/models/work_items/type.rb b/app/models/work_items/type.rb index 2bf41c206d826..3803999400b85 100644 --- a/app/models/work_items/type.rb +++ b/app/models/work_items/type.rb @@ -41,7 +41,7 @@ class Type < ApplicationRecord issue: { name: TYPE_NAMES[:issue], icon_name: 'issue-type-issue', enum_value: 0, id: 1 }, incident: { name: TYPE_NAMES[:incident], icon_name: 'issue-type-incident', enum_value: 1, id: 2 }, test_case: { name: TYPE_NAMES[:test_case], icon_name: 'issue-type-test-case', enum_value: 2, id: 3 }, ## EE-only - requirement: { name: TYPE_NAMES[:requirement], icon_name: 'issue-type-requirements', enum_value: 3, id: 4 }, ## EE-only # rubocop:disable Layout/LineLength -- Only comment exceeds length + requirement: { name: TYPE_NAMES[:requirement], icon_name: 'issue-type-requirements', enum_value: 3, id: 4 }, ## EE task: { name: TYPE_NAMES[:task], icon_name: 'issue-type-task', enum_value: 4, id: 5 }, objective: { name: TYPE_NAMES[:objective], icon_name: 'issue-type-objective', enum_value: 5, id: 6 }, ## EE-only key_result: { name: TYPE_NAMES[:key_result], icon_name: 'issue-type-keyresult', enum_value: 6, id: 7 }, ## EE-only diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb index 20150cc7c3e87..57be3952ba53f 100644 --- a/app/policies/issue_policy.rb +++ b/app/policies/issue_policy.rb @@ -45,13 +45,11 @@ def epics_license_available? end end - # rubocop:disable Gitlab/FeatureFlagWithoutActor -- this is a on/off toggle # group level issues license for now is equivalent to epics license. We'll have to migrate epics license to # work items context once epics are fully migrated to work items. condition(:group_level_issues_license_available) do epics_license_available? end - # rubocop:enable Gitlab/FeatureFlagWithoutActor rule { group_issue & can?(:read_group) }.policy do enable :create_note diff --git a/app/services/ci/runners/set_runner_associated_projects_service.rb b/app/services/ci/runners/set_runner_associated_projects_service.rb index 9c18f672c24f9..ec79b0c433cbb 100644 --- a/app/services/ci/runners/set_runner_associated_projects_service.rb +++ b/app/services/ci/runners/set_runner_associated_projects_service.rb @@ -30,7 +30,7 @@ def set_associated_projects response = ServiceResponse.success runner.transaction do - current_project_ids = runner.project_ids # rubocop:disable CodeReuse/ActiveRecord -- reasonable use + current_project_ids = runner.project_ids response = associate_new_projects(new_project_ids, current_project_ids) response = disassociate_old_projects(new_project_ids, current_project_ids) if response.success? diff --git a/app/services/work_items/data_sync/clone_service.rb b/app/services/work_items/data_sync/clone_service.rb index e59a47b0945ed..7f893cd679ca2 100644 --- a/app/services/work_items/data_sync/clone_service.rb +++ b/app/services/work_items/data_sync/clone_service.rb @@ -41,7 +41,7 @@ def verify_can_clone_work_item(work_item, target_namespace) return error(error_message, :unprocessable_entity) end - if target_namespace.pending_delete? # rubocop:disable Style/GuardClause -- does not read right with other checks above + if target_namespace.pending_delete? error_message = s_('CloneWorkItem|Cannot clone work item to target namespace as it is pending deletion.') return error(error_message, :unprocessable_entity) diff --git a/app/services/work_items/data_sync/move_service.rb b/app/services/work_items/data_sync/move_service.rb index d5c668a9a97f1..52211caa8c80f 100644 --- a/app/services/work_items/data_sync/move_service.rb +++ b/app/services/work_items/data_sync/move_service.rb @@ -33,7 +33,7 @@ def verify_can_move_work_item(work_item, target_namespace) return error(error_message, :unprocessable_entity) end - if target_namespace.pending_delete? # rubocop:disable Style/GuardClause -- does not read right with other checks above + if target_namespace.pending_delete? error_message = s_('MoveWorkItem|Cannot move work item to target namespace as it is pending deletion.') return error(error_message, :unprocessable_entity) diff --git a/db/migrate/20241021082113_create_partitioned_ci_runners.rb b/db/migrate/20241021082113_create_partitioned_ci_runners.rb index 79c3fec301835..d61018f8d3a21 100644 --- a/db/migrate/20241021082113_create_partitioned_ci_runners.rb +++ b/db/migrate/20241021082113_create_partitioned_ci_runners.rb @@ -35,7 +35,6 @@ def down def create_partitioned_table(name) options = 'PARTITION BY LIST (runner_type)' - # rubocop: disable Migration/EnsureFactoryForTable -- we'll reuse the ci_runners factory once migrated create_table name, primary_key: PARTITIONED_TABLE_PK, options: options do |t| t.bigint :id, null: false t.bigint :creator_id @@ -88,6 +87,5 @@ def create_partitioned_table(name) t.index %i[token_expires_at id], name: "idx_#{name}_on_token_expires_at_desc_and_id_desc", order: { token_expires_at: :desc, runner_type: :asc, id: :desc } end - # rubocop: enable Migration/EnsureFactoryForTable end end diff --git a/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb b/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb index d2e4376d25819..f7d6dd49807ea 100644 --- a/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb +++ b/db/migrate/20241024204816_create_partitioned_ci_runner_managers.rb @@ -28,7 +28,6 @@ def down def create_partitioned_table(name) options = 'PARTITION BY LIST (runner_type)' - # rubocop: disable Migration/EnsureFactoryForTable -- we'll reuse the ci_runner_machines factory once migrated create_table name, primary_key: PARTITIONED_TABLE_PK, options: options do |t| t.bigint :id, null: false t.bigint :runner_id, null: false @@ -59,6 +58,5 @@ def create_partitioned_table(name) name: "index_#{name}_on_patch_version" t.index :version, name: "index_#{name}_on_version" end - # rubocop: enable Migration/EnsureFactoryForTable end end diff --git a/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb b/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb index 5f9beb6e4b344..06b460228728f 100644 --- a/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb +++ b/db/post_migrate/20241021163518_drop_user_canonical_emails_table.rb @@ -12,7 +12,7 @@ def down create_table :user_canonical_emails do |t| t.timestamps_with_timezone t.references :user, index: false, null: false, foreign_key: { on_delete: :cascade } - t.string :canonical_email, null: false, index: true # rubocop:disable Migration/AddLimitToStringColumns -- limit ignored in original migration + t.string :canonical_email, null: false, index: true end add_index :user_canonical_emails, [:user_id, :canonical_email], unique: true diff --git a/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb b/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb index 0b6439112b737..b2ccf97800ac3 100644 --- a/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb +++ b/ee/app/controllers/ee/projects/settings/ci_cd_controller.rb @@ -38,7 +38,7 @@ def define_protected_env_variables @protected_environments = @project.protected_environments.with_environment_id.sorted_by_name @protected_environment = ProtectedEnvironment.new(project: @project) # ignoring Layout/LineLength because if we break this into multiple lines, we cause Style/GuardClause errors - @group_protected_environments = ProtectedEnvironment.for_groups(@project.group.self_and_ancestor_ids) if @project.group # rubocop:disable Layout/LineLength + @group_protected_environments = ProtectedEnvironment.for_groups(@project.group.self_and_ancestor_ids) if @project.group # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective end def assign_variables_to_gon diff --git a/ee/app/models/ee/audit_events/project_audit_event.rb b/ee/app/models/ee/audit_events/project_audit_event.rb index a21940ac87798..4650bd02fef2a 100644 --- a/ee/app/models/ee/audit_events/project_audit_event.rb +++ b/ee/app/models/ee/audit_events/project_audit_event.rb @@ -28,7 +28,7 @@ def entity_type end def present - AuditEventPresenter.new(self) # rubocop:disable CodeReuse/Presenter -- This is called in AuditEventSerializer + AuditEventPresenter.new(self) end def root_group_entity diff --git a/ee/app/services/search/zoekt/routing_service.rb b/ee/app/services/search/zoekt/routing_service.rb index c9f37b70ea0cc..72d9ae194d3b3 100644 --- a/ee/app/services/search/zoekt/routing_service.rb +++ b/ee/app/services/search/zoekt/routing_service.rb @@ -20,7 +20,6 @@ def initialize(projects) # @returns [Hash] { node_id => [1,2,3], node_id2 => [4,5,6] } # rubocop:disable CodeReuse/ActiveRecord -- this service builds a complex custom AR query # rubocop:disable Database/AvoidUsingPluckWithoutLimit -- we restrict the number of projects in the guard clause - # rubocop:disable Layout/LineLength -- not breaking lines for better readability def execute raise "Too many projects" if projects.count > MAX_NUMBER_OF_PROJECTS @@ -49,7 +48,7 @@ def fetch_projects_through_replicas projects.without_order.joins(zoekt_repositories: { zoekt_index: { replica: :zoekt_enabled_namespace } }) .merge(EnabledNamespace.search_enabled).merge(Replica.ready) end - # rubocop:enable CodeReuse/ActiveRecord, Layout/LineLength, Database/AvoidUsingPluckWithoutLimit + # rubocop:enable CodeReuse/ActiveRecord, Database/AvoidUsingPluckWithoutLimit end end end diff --git a/ee/app/services/vulnerabilities/statistics/adjustment_service.rb b/ee/app/services/vulnerabilities/statistics/adjustment_service.rb index 582ad4a922695..e18e1c65dd3f8 100644 --- a/ee/app/services/vulnerabilities/statistics/adjustment_service.rb +++ b/ee/app/services/vulnerabilities/statistics/adjustment_service.rb @@ -92,11 +92,9 @@ def execute delegate :connection, to: ApplicationRecord, private: true - # rubocop: disable Database/AvoidUsingPluckWithoutLimit -- already limited by caller BulkDismissService def filter_project_ids self.project_ids = Project.id_in(project_ids).pluck_primary_key end - # rubocop: enable Database/AvoidUsingPluckWithoutLimit def upsert_sql UPSERT_SQL % { stats_sql: stats_sql } diff --git a/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb b/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb index bb1a3aff767fe..ca0be1210e4e4 100644 --- a/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb +++ b/ee/db/geo/migrate/20210504143244_add_verification_to_merge_request_diff_registry.rb @@ -12,7 +12,7 @@ def up add_column_unless_exists :checksum_mismatch, :boolean add_column_unless_exists :verification_checksum, :binary add_column_unless_exists :verification_checksum_mismatched, :binary - add_column_unless_exists :verification_failure, :string, limit: 255 # rubocop:disable Migration/PreventStrings -- See https://gitlab.com/gitlab-org/gitlab/-/issues/323806 + add_column_unless_exists :verification_failure, :string, limit: 255 end def add_column_unless_exists(column_name, type, **options) diff --git a/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb b/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb index 7c9e53a20a8d0..e471306778173 100644 --- a/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb +++ b/ee/lib/ee/gitlab/background_migration/create_missing_external_links_for_vulnerabilities.rb @@ -131,7 +131,8 @@ def initialize(jira_integration) def execute(page, per_page) jql = build_jql start_at = (page - 1) * per_page - url = "#{context_path}/rest/api/2/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&maxResults=#{per_page}&fields=description,project" # rubocop:disable Layout/LineLength -- Whole URL is too long + url = "#{context_path}/rest/api/2/search?jql=#{CGI.escape(jql)}&startAt=#{start_at}&" \ + "maxResults=#{per_page}&fields=description,project" request(url) end diff --git a/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb b/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb index ef6d2ef542cda..9b6b73ea115ed 100644 --- a/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb +++ b/ee/lib/gitlab/llm/completions/resolve_vulnerability/helpers.rb @@ -140,10 +140,7 @@ def create_merge_request_with_resolution( def add_note_from_vulnerable_mr_to_resolution(vulnerable_mr, resolution_mr, vulnerability, user) return unless vulnerable_mr - # rubocop: disable CodeReuse/Presenter -- Presenter methods are used in ERB presentation. finding_presenter = Vulnerabilities::FindingPresenter.new(vulnerability.finding) - # rubocop: enable CodeReuse/Presenter - resolution_mr_url = Gitlab::Routing.url_helpers.project_merge_request_url( resolution_mr.project, resolution_mr diff --git a/ee/spec/features/groups/settings/domain_verification_spec.rb b/ee/spec/features/groups/settings/domain_verification_spec.rb index 852e782885ccd..13d6fc57689e2 100644 --- a/ee/spec/features/groups/settings/domain_verification_spec.rb +++ b/ee/spec/features/groups/settings/domain_verification_spec.rb @@ -41,7 +41,7 @@ it 'displays no domains present message' do visit_domain_verification_page - expect(page).to have_content s_('DomainVerification|No domains configured. Create a domain in a project in this group hierarchy.') # rubocop:disable Layout/LineLength + expect(page).to have_content s_('DomainVerification|No domains configured. Create a domain in a project in this group hierarchy.') end end diff --git a/ee/spec/features/projects/mirror_spec.rb b/ee/spec/features/projects/mirror_spec.rb index 15d4a87c6cdc5..3b178db9b9214 100644 --- a/ee/spec/features/projects/mirror_spec.rb +++ b/ee/spec/features/projects/mirror_spec.rb @@ -205,7 +205,7 @@ def add_mirror end end - it 'can be changed to unauthenticated', quarantine: 'https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1486' do # rubocop:disable Layout/LineLength + it 'can be changed to unauthenticated', quarantine: 'https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1486' do project.update!(import_url: 'http://user:password@example.com') visit project_settings_repository_path(project) diff --git a/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb b/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb index e5fa586f98f45..e7686c03cda94 100644 --- a/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb +++ b/ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb @@ -114,7 +114,7 @@ def doc(text) expect(control.count).to eq 1 - markdown = "#{cadence.to_reference} #{cadence.to_reference(format: :title)} #{another_cadence.to_reference} #{another_cadence.to_reference(format: :title)}" # rubocop:disable Layout/LineLength -- readability + markdown = "#{cadence.to_reference} #{cadence.to_reference(format: :title)} #{another_cadence.to_reference} #{another_cadence.to_reference(format: :title)}" expect { reference_filter(markdown, context) }.not_to exceed_all_query_limit(1) end diff --git a/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb b/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb index e47209edb0138..031c1873f4b6c 100644 --- a/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb +++ b/ee/spec/lib/gitlab/background_migration/create_missing_external_links_for_vulnerabilities_spec.rb @@ -230,7 +230,10 @@ def self.encryption_options let(:finder) { described_class::JiraIssuesFinder.new(mock_jira_integration) } it "makes a call to the correct jira url" do - expect(finder).to receive(:request).with("/rest/api/2/search?jql=project+in+%28key1%2C+key2%29+AND+description+~+%22Issue+created+from+vulnerability%22+order+by+created+DESC&startAt=0&maxResults=100&fields=description,project") # rubocop:disable Layout/LineLength -- URL is too long + expect(finder).to receive(:request) + .with("/rest/api/2/search?jql=project+in+%28key1%2C+key2%29+AND+description+~+%" \ + "22Issue+created+from+vulnerability%22+order+by+created+DESC&startAt=0&" \ + "maxResults=100&fields=description,project") finder.execute(1, 100) end diff --git a/ee/spec/lib/gitlab/elastic/client_spec.rb b/ee/spec/lib/gitlab/elastic/client_spec.rb index 7d749a512f577..037c12bdcf346 100644 --- a/ee/spec/lib/gitlab/elastic/client_spec.rb +++ b/ee/spec/lib/gitlab/elastic/client_spec.rb @@ -114,7 +114,8 @@ end let(:meta_string) do - "es=#{Elasticsearch::VERSION},rb=#{RUBY_VERSION},t=#{Elasticsearch::Transport::VERSION},fd=#{Faraday::VERSION},ty=#{Typhoeus::VERSION}" # rubocop:disable Layout/LineLength -- This is just a long string + "es=#{Elasticsearch::VERSION},rb=#{RUBY_VERSION},t=#{Elasticsearch::Transport::VERSION}," \ + "fd=#{Faraday::VERSION},ty=#{Typhoeus::VERSION}" end it 'signs_requests' do diff --git a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb index dc760b5a131d1..4ad44387ccb59 100644 --- a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb +++ b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_secure_pipelines_metric_spec.rb @@ -112,7 +112,9 @@ let(:start) { 30.days.ago.to_fs(:db) } let(:finish) { 2.days.ago.to_fs(:db) } let(:expected_query) do - %{SELECT COUNT(DISTINCT "security_scans"."pipeline_id") FROM "security_scans" WHERE "security_scans"."created_at" BETWEEN '#{start}' AND '#{finish}' AND "security_scans"."scan_type" = #{scan_type}} # rubocop:disable Layout/LineLength + "SELECT COUNT(DISTINCT \"security_scans\".\"pipeline_id\") FROM \"security_scans\" WHERE " \ + "\"security_scans\".\"created_at\" BETWEEN '#{start}' AND '#{finish}' AND " \ + "\"security_scans\".\"scan_type\" = #{scan_type}" end it 'has correct value' do diff --git a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb index d567d37be5625..08bd23f1c6989 100644 --- a/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb +++ b/ee/spec/lib/gitlab/usage/metrics/instrumentations/count_security_scans_metric_spec.rb @@ -18,9 +18,9 @@ let(:scan_type) { scan_type } let(:expected_query) do if params[:time_frame] == 'all' - %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."scan_type" = #{scan_type}} # rubocop:disable Layout/LineLength + %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."scan_type" = #{scan_type}} else - %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."created_at" BETWEEN '#{start}' AND '#{finish}' AND "security_scans"."scan_type" = #{scan_type}} # rubocop:disable Layout/LineLength + %{SELECT COUNT("security_scans"."build_id") FROM "security_scans" WHERE "security_scans"."created_at" BETWEEN '#{start}' AND '#{finish}' AND "security_scans"."scan_type" = #{scan_type}} end end diff --git a/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb b/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb index 25aa5e141cc31..59d96059853a7 100644 --- a/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb +++ b/ee/spec/services/merge_requests/create_from_vulnerability_data_service_spec.rb @@ -332,7 +332,6 @@ end end - # rubocop:disable RSpec/MultipleMemoizedHelpers -- Need helpers for scenarios context 'when params are valid' do let(:params) { { llm_patch: llm_patch, description_options: { analysis_data: analysis_data, summary_data: summary_data } } } @@ -570,6 +569,5 @@ end end end - # rubocop:enable RSpec/MultipleMemoizedHelpers end end diff --git a/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb b/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb index 82cedf0bb9a91..bdeafa308cab6 100644 --- a/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb +++ b/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb @@ -24,7 +24,7 @@ visit page_path expect(page).to have_content( - s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') # rubocop:disable Layout/LineLength -- Single string + s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') ) link = page.find_link(restricted_group.path) @@ -48,7 +48,7 @@ visit page_path expect(page).not_to have_content( - s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') # rubocop:disable Layout/LineLength -- Single string + s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') ) end end diff --git a/ee/spec/views/admin/users/show.html.haml_spec.rb b/ee/spec/views/admin/users/show.html.haml_spec.rb index 259f92fea5f8e..d49966cc75f73 100644 --- a/ee/spec/views/admin/users/show.html.haml_spec.rb +++ b/ee/spec/views/admin/users/show.html.haml_spec.rb @@ -94,8 +94,8 @@ let(:timestamp) { page.at("[data-testid=\"#{test_id}\"]") } where(:sent_at_attr, :test_id, :displayed, :label) do - :confirmation_sent_at | 'email-confirmation-code-last-sent-at' | lazy { timestamp } | 'Email confirmation code last sent at' # rubocop:disable Layout/LineLength -- should be in a single line - :locked_at | 'email-verification-code-last-sent-at' | lazy { timestamp } | 'Locked account email verification code last sent at' # rubocop:disable Layout/LineLength -- should be in a single line + :confirmation_sent_at | 'email-confirmation-code-last-sent-at' | lazy { timestamp } | 'Email confirmation code last sent at' # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- should be in a single line + :locked_at | 'email-verification-code-last-sent-at' | lazy { timestamp } | 'Locked account email verification code last sent at' # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- should be in a single line end with_them do diff --git a/lib/api/submodules.rb b/lib/api/submodules.rb index 454454da67c45..dbeff31fd028e 100644 --- a/lib/api/submodules.rb +++ b/lib/api/submodules.rb @@ -2,7 +2,7 @@ module API class Submodules < ::API::Base - SUBMODULE_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(submodule: API::NO_SLASH_URL_PART_REGEX) # rubocop:disable Layout/LineLength -- no way to shorten this and adhere to naming convention + SUBMODULE_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(submodule: API::NO_SLASH_URL_PART_REGEX) before { authenticate! } diff --git a/lib/gitlab/background_migration/backfill_security_policies.rb b/lib/gitlab/background_migration/backfill_security_policies.rb index eaef26415b256..7d2a4b5f549b7 100644 --- a/lib/gitlab/background_migration/backfill_security_policies.rb +++ b/lib/gitlab/background_migration/backfill_security_policies.rb @@ -10,4 +10,4 @@ def perform; end end end -Gitlab::BackgroundMigration::BackfillSecurityPolicies.prepend_mod_with('Gitlab::BackgroundMigration::BackfillSecurityPolicies') # rubocop:disable Layout/LineLength -- ignore +Gitlab::BackgroundMigration::BackfillSecurityPolicies.prepend_mod diff --git a/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb b/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb index 3436df9ba0d88..a2303afda9e75 100644 --- a/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb +++ b/lib/gitlab/background_migration/project_bot_user_details_bot_namespace_migration.rb @@ -10,7 +10,6 @@ class ProjectBotUserDetailsBotNamespaceMigration < BatchedMigrationJob feature_category :system_access - # rubocop:disable Metrics/BlockLength -- Method is long due to formatted SQL def perform each_sub_batch do |sub_batch| connection.execute( @@ -39,7 +38,6 @@ def perform ) end end - # rubocop:enable Metrics/BlockLength end end end diff --git a/lib/gitlab/popen/runner.rb b/lib/gitlab/popen/runner.rb index cd9ad270cd80c..1cef3b84ef30e 100644 --- a/lib/gitlab/popen/runner.rb +++ b/lib/gitlab/popen/runner.rb @@ -12,7 +12,7 @@ def initialize def run(commands, &block) commands.each do |cmd| # yield doesn't support blocks, so we need to use a block variable - block.call(cmd) do # rubocop:disable Performance/RedundantBlockCall + block.call(cmd) do cmd_result = Gitlab::Popen.popen_with_detail(cmd) results << cmd_result diff --git a/qa/qa/resource/user_runners.rb b/qa/qa/resource/user_runners.rb index da1c808bb681d..fb504bc725f9a 100644 --- a/qa/qa/resource/user_runners.rb +++ b/qa/qa/resource/user_runners.rb @@ -27,7 +27,7 @@ def initialize @run_untagged = nil @name = "qa-runner-#{SecureRandom.hex(4)}" @executor = :shell - @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" # rubocop:disable Layout/LineLength -- image path + @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" end def fabricate! diff --git a/qa/qa/service/docker_run/gitlab_runner.rb b/qa/qa/service/docker_run/gitlab_runner.rb index c9885791a634a..7283a65fe8523 100644 --- a/qa/qa/service/docker_run/gitlab_runner.rb +++ b/qa/qa/service/docker_run/gitlab_runner.rb @@ -15,10 +15,10 @@ class GitlabRunner < Base MSG def initialize(name) - @image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.runner_container_image}" # rubocop:disable Layout/LineLength + @image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.runner_container_image}" @name = name || "qa-runner-#{SecureRandom.hex(4)}" @executor = :shell - @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" # rubocop:disable Layout/LineLength + @executor_image = "#{QA::Runtime::Env.container_registry_host}/#{QA::Runtime::Env.runner_container_namespace}/#{QA::Runtime::Env.gitlab_qa_build_image}" super() end diff --git a/qa/qa/vendor/one_password/cli.rb b/qa/qa/vendor/one_password/cli.rb index f443ba0549232..191c50618defa 100644 --- a/qa/qa/vendor/one_password/cli.rb +++ b/qa/qa/vendor/one_password/cli.rb @@ -51,7 +51,7 @@ def current_otp # But note that if we add more tests that use this class, we might need to add a mechanism to invalidate # the cache after 30 minutes or if the session_token is rejected by op CLI. def session_token - @session_token ||= `echo '#{@password}' | op account add --address #{@address} --email #{@email} --secret-key #{@secret} --signin --raw` # rubocop:disable Layout/LineLength + @session_token ||= `echo '#{@password}' | op account add --address #{@address} --email #{@email} --secret-key #{@secret} --signin --raw` end end end diff --git a/spec/components/previews/pajamas/banner_component_preview.rb b/spec/components/previews/pajamas/banner_component_preview.rb index 8bb7b82527d84..e3942895cd916 100644 --- a/spec/components/previews/pajamas/banner_component_preview.rb +++ b/spec/components/previews/pajamas/banner_component_preview.rb @@ -42,7 +42,7 @@ def with_primary_action_slot def with_illustration_slot render(Pajamas::BannerComponent.new) do |c| c.with_illustration do - '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-up"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>'.html_safe # rubocop:disable Layout/LineLength + '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-up"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>'.html_safe # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective end content_tag :p, "This banner uses the illustration slot." end diff --git a/spec/features/groups/participants_autocomplete_spec.rb b/spec/features/groups/participants_autocomplete_spec.rb index 77423ef82a6a2..90ae5540a1f25 100644 --- a/spec/features/groups/participants_autocomplete_spec.rb +++ b/spec/features/groups/participants_autocomplete_spec.rb @@ -37,7 +37,7 @@ create(:group_group_link, shared_group: group, shared_with_group: private_group) end - it 'suggests member of private group as well', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/444683' do # rubocop:disable Layout/LineLength -- We prefer to keep it on a single line, for simplicity sake + it 'suggests member of private group as well', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/444683' do visit edit_group_milestone_path(group, noteable) fill_in 'Description', with: '@' diff --git a/spec/features/merge_request/user_edits_mr_spec.rb b/spec/features/merge_request/user_edits_mr_spec.rb index de277688a9838..ac5e764c302f4 100644 --- a/spec/features/merge_request/user_edits_mr_spec.rb +++ b/spec/features/merge_request/user_edits_mr_spec.rb @@ -94,7 +94,7 @@ expect(page).to have_content( format( - _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), # rubocop:disable Layout/LineLength + _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), model_name: _('merge request'), link_to_model: _('merge request') ) diff --git a/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb b/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb index fb433923db50a..fd55050d4b9f9 100644 --- a/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb +++ b/spec/lib/gitlab/doorkeeper_secret_storing/secret/pbkdf2_sha512_spec.rb @@ -8,7 +8,7 @@ it 'generates a PBKDF2+SHA512 hashed value in the correct format' do expect(described_class.transform_secret(plaintext_secret)) - .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") # rubocop:disable Layout/LineLength + .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") end end @@ -27,7 +27,7 @@ describe '.secret_matches?' do it "match by hashing the input if the stored value is hashed" do plain_secret = 'plain_secret' - stored_value = '$pbkdf2-sha512$20000$$/BwQRdwSpL16xkQhstavh7nvA5avCP7.4n9LLKe9AupgJDeA7M5xOAvG3N3E5XbRyGWWBbbr.BsojPVWzd1Sqg' # rubocop:disable Layout/LineLength + stored_value = '$pbkdf2-sha512$20000$$/BwQRdwSpL16xkQhstavh7nvA5avCP7.4n9LLKe9AupgJDeA7M5xOAvG3N3E5XbRyGWWBbbr.BsojPVWzd1Sqg' expect(described_class.secret_matches?(plain_secret, stored_value)).to be true end end diff --git a/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb b/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb index e267d27ed1396..8163817f62e0b 100644 --- a/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb +++ b/spec/lib/gitlab/doorkeeper_secret_storing/token/pbkdf2_sha512_spec.rb @@ -8,7 +8,7 @@ it 'generates a PBKDF2+SHA512 hashed value in the correct format' do expect(described_class.transform_secret(plaintext_token)) - .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") # rubocop:disable Layout/LineLength + .to eq("$pbkdf2-sha512$20000$$.c0G5XJVEew1TyeJk5TrkvB0VyOaTmDzPrsdNRED9vVeZlSyuG3G90F0ow23zUCiWKAVwmNnR/ceh.nJG3MdpQ") end end diff --git a/spec/lib/gitlab/merge_requests/message_generator_spec.rb b/spec/lib/gitlab/merge_requests/message_generator_spec.rb index b1b355b2f3994..13af4033368d0 100644 --- a/spec/lib/gitlab/merge_requests/message_generator_spec.rb +++ b/spec/lib/gitlab/merge_requests/message_generator_spec.rb @@ -260,7 +260,7 @@ context 'when project has template with CRLF newlines' do let(message_template_name) do - "Merge branch '%{source_branch}' into '%{target_branch}'\r\n\r\n%{title}\r\n\r\n%{description}\r\n\r\nSee merge request %{reference}" # rubocop: disable Layout/LineLength + "Merge branch '%{source_branch}' into '%{target_branch}'\r\n\r\n%{title}\r\n\r\n%{description}\r\n\r\nSee merge request %{reference}" end it 'converts it to LF newlines' do diff --git a/spec/lib/gitlab/search/abuse_detection_spec.rb b/spec/lib/gitlab/search/abuse_detection_spec.rb index f849b1f996bf1..e500faf93d5e1 100644 --- a/spec/lib/gitlab/search/abuse_detection_spec.rb +++ b/spec/lib/gitlab/search/abuse_detection_spec.rb @@ -83,7 +83,7 @@ word | { query_string: ['stopword only abusive search detected'] } end - (['apples'] * (described_class::MAX_PIPE_SYNTAX_FILTERS + 1)).join('|') | { query_string: ['too many pipe syntax filters'] } # rubocop:disable Layout/LineLength + (['apples'] * (described_class::MAX_PIPE_SYNTAX_FILTERS + 1)).join('|') | { query_string: ['too many pipe syntax filters'] } (['apples'] * described_class::MAX_PIPE_SYNTAX_FILTERS).join('|') | {} 'x' | { query_string: ['abusive tiny search detected'] } 'apples|x' | { query_string: ['abusive tiny search detected'] } diff --git a/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb b/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb index 5ee2c31165524..154900938b458 100644 --- a/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb +++ b/spec/migrations/db/post_migrate/20240319005754_swap_columns_for_upstream_pipeline_id_between_ci_builds_and_ci_pipelines_spec.rb @@ -40,7 +40,7 @@ :p_ci_builds, [:commit_id, :artifacts_expire_at, :id], name: :p_ci_builds_commit_id_artifacts_expire_at_id_convert_to_big_idx, - where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))" # rubocop:disable Layout/LineLength -- Just too long + where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))" ) end diff --git a/spec/models/concerns/encrypted_user_password_spec.rb b/spec/models/concerns/encrypted_user_password_spec.rb index b644731396765..2ee3867fcd47d 100644 --- a/spec/models/concerns/encrypted_user_password_spec.rb +++ b/spec/models/concerns/encrypted_user_password_spec.rb @@ -17,7 +17,10 @@ end context 'when password is stored in PBKDF2 format' do - let(:encrypted_password) { '$pbkdf2-sha512$20000$rKbYsScsDdk$iwWBewXmrkD2fFfaG1SDcMIvl9gvEo3fBWUAfiqyVceTlw/DYgKBByHzf45pF5Qn59R4R.NQHsFpvZB4qlsYmw' } # rubocop:disable Layout/LineLength + let(:encrypted_password) do + '$pbkdf2-sha512$20000$rKbYsScsDdk$iwWBewXmrkD2fFfaG1SDcMIvl9gvEo3fBWUAfiqyVceTlw/DYgKBByHzf45pF5Qn59R4R.NQHs' \ + 'FpvZB4qlsYmw' + end it 'uses the decoded password salt' do expect(authenticatable_salt).to eq('aca6d8b1272c0dd9') diff --git a/spec/requests/api/alert_management_alerts_spec.rb b/spec/requests/api/alert_management_alerts_spec.rb index 8dd0c46eab62a..bd08bed02f6be 100644 --- a/spec/requests/api/alert_management_alerts_spec.rb +++ b/spec/requests/api/alert_management_alerts_spec.rb @@ -303,7 +303,9 @@ context 'and metric image not found' do subject do - put api("/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user) # rubocop: disable Layout/LineLength + put api( + "/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user + ) end it 'returns an error' do @@ -378,7 +380,9 @@ context 'when metric image not found' do subject do - delete api("/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user) # rubocop: disable Layout/LineLength + delete api( + "/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user + ) end it 'returns an error' do diff --git a/spec/requests/projects/releases_controller_spec.rb b/spec/requests/projects/releases_controller_spec.rb index bb12f80f0fa45..8cf1c83e13d93 100644 --- a/spec/requests/projects/releases_controller_spec.rb +++ b/spec/requests/projects/releases_controller_spec.rb @@ -107,7 +107,7 @@ context 'when private project' do let_it_be(:private_project) { create(:project, :repository, :private) } - it_behaves_like 'authenticates sessionless user for the request spec', 'index atom', public_resource: false, ignore_metrics: true do # rubocop:disable Layout/LineLength -- We prefer to keep it on a single line, for simplicity sake + it_behaves_like 'authenticates sessionless user for the request spec', 'index atom', public_resource: false, ignore_metrics: true do let(:url) { project_releases_url(private_project, format: :atom) } before do diff --git a/spec/scripts/setup/tests-metadata_spec.rb b/spec/scripts/setup/tests-metadata_spec.rb index 29b7df39e8d7b..0ca58448331c8 100644 --- a/spec/scripts/setup/tests-metadata_spec.rb +++ b/spec/scripts/setup/tests-metadata_spec.rb @@ -6,7 +6,7 @@ # rubocop:disable Gitlab/Json, Lint/MissingCopEnableDirective -- It's not intended to have extra dependency -RSpec.describe TestsMetadata, feature_category: :tooling do # rubocop:disable Rails/FilePath,RSpec/SpecFilePathFormat -- We use dashes in scripts +RSpec.describe TestsMetadata, feature_category: :tooling do # rubocop:disable RSpec/SpecFilePathFormat -- We use dashes in scripts subject(:metadata) do described_class.new( mode: mode, diff --git a/spec/services/ci/create_pipeline_service/logger_spec.rb b/spec/services/ci/create_pipeline_service/logger_spec.rb index aee2f9b637003..d7027f624c5ab 100644 --- a/spec/services/ci/create_pipeline_service/logger_spec.rb +++ b/spec/services/ci/create_pipeline_service/logger_spec.rb @@ -2,8 +2,7 @@ require 'spec_helper' -RSpec.describe Ci::CreatePipelineService, # rubocop: disable RSpec/SpecFilePathForm - feature_category: :continuous_integration do +RSpec.describe Ci::CreatePipelineService, feature_category: :continuous_integration do describe 'pipeline logger' do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { project.first_owner } diff --git a/spec/services/packages/conan/create_package_service_spec.rb b/spec/services/packages/conan/create_package_service_spec.rb index 602179a122433..c056dd5f42085 100644 --- a/spec/services/packages/conan/create_package_service_spec.rb +++ b/spec/services/packages/conan/create_package_service_spec.rb @@ -169,15 +169,12 @@ stub_feature_flags(packages_protected_packages_conan: false) end - # rubocop:disable Layout/LineLength -- Avoid formatting to keep one-line table syntax where(:package_name_pattern, :minimum_access_level_for_push, :user) do ref(:package_name) | :maintainer | ref(:project_developer) ref(:package_name) | :admin | ref(:project_owner) ref(:package_name_pattern_no_match) | :maintainer | ref(:project_developer) ref(:package_name_pattern_no_match) | :admin | ref(:project_owner) end - # rubocop:enable Layout/LineLength - with_them do it_behaves_like 'a service response for valid package' end diff --git a/spec/services/packages/pypi/create_package_service_spec.rb b/spec/services/packages/pypi/create_package_service_spec.rb index 954c25083f564..28a636967a860 100644 --- a/spec/services/packages/pypi/create_package_service_spec.rb +++ b/spec/services/packages/pypi/create_package_service_spec.rb @@ -278,7 +278,7 @@ minimum_access_level_for_push: minimum_access_level_for_push) end - # rubocop:disable Layout/LineLength -- Avoid formatting to keep one-line table syntax + # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- Avoid formatting to keep one-line table syntax where(:package_name_pattern, :minimum_access_level_for_push, :user, :shared_examples_name) do ref(:package_name) | :maintainer | ref(:project_developer) | 'an error service response for protected package' ref(:package_name) | :maintainer | ref(:project_maintainer) | 'a service response for valid package' @@ -297,7 +297,7 @@ ref(:package_name) | :maintainer | nil | 'an error service response for unauthorized' ref(:package_name) | :admin | ref(:unauthorized_deploy_token) | 'an error service response for unauthorized' end - # rubocop:enable Layout/LineLength + # rubocop:enable Layout/LineLength, Lint/RedundantCopDisableDirective with_them do it_behaves_like params[:shared_examples_name] @@ -308,15 +308,12 @@ stub_feature_flags(packages_protected_packages_pypi: false) end - # rubocop:disable Layout/LineLength -- Avoid formatting to keep one-line table syntax where(:package_name_pattern, :minimum_access_level_for_push, :user) do ref(:package_name) | :maintainer | ref(:project_developer) ref(:package_name) | :admin | ref(:project_owner) ref(:package_name_pattern_no_match) | :maintainer | ref(:project_developer) ref(:package_name_pattern_no_match) | :admin | ref(:project_owner) end - # rubocop:enable Layout/LineLength - with_them do it_behaves_like 'a service response for valid package' end diff --git a/spec/services/pages_domains/create_acme_order_service_spec.rb b/spec/services/pages_domains/create_acme_order_service_spec.rb index 46601d07ed9a4..2eab23cae5d32 100644 --- a/spec/services/pages_domains/create_acme_order_service_spec.rb +++ b/spec/services/pages_domains/create_acme_order_service_spec.rb @@ -82,7 +82,7 @@ end where(:lets_encrypt_client_error, :lets_encrypt_client_error_message) do - Acme::Client::Error::RejectedIdentifier | 'Invalid identifiers requested :: Cannot issue for "local": Domain name needs at least one dot' # rubocop:disable Layout/LineLength -- Ensuring one line table syntax + Acme::Client::Error::RejectedIdentifier | 'Invalid identifiers requested :: Cannot issue for "local": Domain name needs at least one dot' # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective -- Ensuring one line table syntax Acme::Client::Error::BadCSR | 'Error finalizing order :: signature algorithm not supported' Acme::Client::Error | 'Other acme client error' Acme::Client::Error | nil diff --git a/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb b/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb index 1f8505978f5ec..4be78f690c34e 100644 --- a/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb +++ b/spec/support/helpers/migrations_helpers/vulnerabilities_findings_helper.rb @@ -20,7 +20,7 @@ def raw_metadata "description" => "The cipher does not provide data integrity update 1", "message" => "The cipher does not provide data integrity", "cve" => "818bf5dacb291e15d9e6dc3c5ac32178:CIPHER", - "solution" => "GCM mode introduces an HMAC into the resulting encrypted data, providing integrity of the result.", # rubocop:disable Layout/LineLength + "solution" => "GCM mode introduces an HMAC into the resulting encrypted data, providing integrity of the result.", "location" => { "file" => "maven/src/main/java/com/gitlab/security_products/tests/App.java", "start_line" => 29, diff --git a/spec/support/helpers/wait_for_requests.rb b/spec/support/helpers/wait_for_requests.rb index b7a3b77a694f2..ab9cca7c6b0f1 100644 --- a/spec/support/helpers/wait_for_requests.rb +++ b/spec/support/helpers/wait_for_requests.rb @@ -72,6 +72,9 @@ def finished_all_js_requests? end def finished_all_ajax_requests? - Capybara.page.evaluate_script('window.pendingRequests || window.pendingApolloRequests || window.pendingRailsUJSRequests || 0').zero? # rubocop:disable Style/NumericPredicate + Capybara + .page + .evaluate_script('window.pendingRequests || window.pendingApolloRequests || window.pendingRailsUJSRequests || 0') + .zero? end end diff --git a/spec/support/shared_examples/features/milestone_editing_shared_examples.rb b/spec/support/shared_examples/features/milestone_editing_shared_examples.rb index 53498a1bb3963..062e8fc364441 100644 --- a/spec/support/shared_examples/features/milestone_editing_shared_examples.rb +++ b/spec/support/shared_examples/features/milestone_editing_shared_examples.rb @@ -14,7 +14,7 @@ expect(page).to have_content( format( - _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), # rubocop:disable Layout/LineLength + _("Someone edited this %{model_name} at the same time you did. Please check out the %{link_to_model} and make sure your changes will not unintentionally remove theirs."), model_name: _('milestone'), link_to_model: _('milestone') ) diff --git a/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb b/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb index 6676fbf070e47..e001a96acb513 100644 --- a/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb +++ b/spec/support/shared_examples/models/concerns/protected_ref_access_shared_examples.rb @@ -131,7 +131,7 @@ context 'when current_user cannot push_code to project' do before do - allow(current_user).to receive(:can?).with(:push_code, project).and_return(false) # rubocop:disable CodeReuse/ActiveRecord -- false positive flag on `with` + allow(current_user).to receive(:can?).with(:push_code, project).and_return(false) end it { is_expected.to eq false } diff --git a/tooling/danger/sidekiq_queues.rb b/tooling/danger/sidekiq_queues.rb index bd6480fcba635..ae32b12868207 100644 --- a/tooling/danger/sidekiq_queues.rb +++ b/tooling/danger/sidekiq_queues.rb @@ -14,7 +14,7 @@ def added_queue_names def changed_queue_names @changed_queue_names ||= (new_queues.values_at(*old_queues.keys) - old_queues.values) - .compact.map { |queue| queue[:name] } # rubocop:disable Rails/Pluck + .compact.map { |queue| queue[:name] } end private diff --git a/tooling/danger/stable_branch.rb b/tooling/danger/stable_branch.rb index abeed0be88a84..13e867b843232 100644 --- a/tooling/danger/stable_branch.rb +++ b/tooling/danger/stable_branch.rb @@ -182,7 +182,7 @@ def versions(page = 1) raise VersionApiError unless response.success? - version_list = response.parsed_response.map { |v| v['version'] } # rubocop:disable Rails/Pluck + version_list = response.parsed_response.map { |v| v['version'] } version_list.sort_by { |v| Gem::Version.new(v) }.reverse end -- GitLab