Commit 27d2bfdc authored by Doug Stull's avatar Doug Stull Committed by Rémy Coutable

Update Rubocop to 0.82.0

- make use of new cops and gitlab-styles updates
parent 7b10fb75
...@@ -80,8 +80,8 @@ linters: ...@@ -80,8 +80,8 @@ linters:
ignored_cops: ignored_cops:
- Layout/BlockAlignment - Layout/BlockAlignment
- Layout/EndAlignment - Layout/EndAlignment
- Layout/LineLength
- Lint/Void - Lint/Void
- Metrics/LineLength
- Naming/FileName - Naming/FileName
- Style/AlignParameters - Style/AlignParameters
- Style/BlockNesting - Style/BlockNesting
...@@ -92,7 +92,6 @@ linters: ...@@ -92,7 +92,6 @@ linters:
- Style/IfUnlessModifier - Style/IfUnlessModifier
- Style/IndentationWidth - Style/IndentationWidth
- Style/Next - Style/Next
- Style/TrailingBlankLines
- Style/TrailingWhitespace - Style/TrailingWhitespace
- Style/WhileUntilModifier - Style/WhileUntilModifier
...@@ -112,7 +111,7 @@ linters: ...@@ -112,7 +111,7 @@ linters:
- Layout/SpaceInsideArrayLiteralBrackets - Layout/SpaceInsideArrayLiteralBrackets
- Layout/SpaceInsideHashLiteralBraces - Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideStringInterpolation - Layout/SpaceInsideStringInterpolation
- Layout/TrailingBlankLines - Layout/TrailingEmptyLines
- Lint/BooleanSymbol - Lint/BooleanSymbol
- Lint/LiteralInInterpolation - Lint/LiteralInInterpolation
- Lint/ParenthesesAsGroupedExpression - Lint/ParenthesesAsGroupedExpression
......
# This configuration was generated by # This configuration was generated by
# `haml-lint --auto-gen-config` # `haml-lint --auto-gen-config`
# on 2020-04-20 07:11:26 +0000 using Haml-Lint version 0.34.0. # on 2020-05-21 10:58:59 -0400 using Haml-Lint version 0.34.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the lints are removed from the code base. # one by one as the lints are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
......
...@@ -13,7 +13,7 @@ inherit_mode: ...@@ -13,7 +13,7 @@ inherit_mode:
AllCops: AllCops:
TargetRubyVersion: 2.6 TargetRubyVersion: 2.6
TargetRailsVersion: 5.0 TargetRailsVersion: 6.0
Exclude: Exclude:
- 'vendor/**/*' - 'vendor/**/*'
- 'node_modules/**/*' - 'node_modules/**/*'
...@@ -186,6 +186,14 @@ Rails/FindBy: ...@@ -186,6 +186,14 @@ Rails/FindBy:
- 'spec/**/*.rb' - 'spec/**/*.rb'
- 'ee/spec/**/*.rb' - 'ee/spec/**/*.rb'
# This is currently exiting with a rubocop exception error and should be
# resolved hopefully a future update
# An error occurred while Rails/UniqueValidationWithoutIndex cop was inspecting
# app/models/abuse_report.rb:15:2.
# To see the complete backtrace run rubocop -d.
Rails/UniqueValidationWithoutIndex:
Enabled: false
# GitLab ################################################################### # GitLab ###################################################################
Gitlab/ModuleWithInstanceVariables: Gitlab/ModuleWithInstanceVariables:
...@@ -260,7 +268,7 @@ Style/ReturnNil: ...@@ -260,7 +268,7 @@ Style/ReturnNil:
Performance/RegexpMatch: Performance/RegexpMatch:
Enabled: false Enabled: false
ActiveRecordAssociationReload: Cop/ActiveRecordAssociationReload:
Enabled: true Enabled: true
Exclude: Exclude:
- 'spec/**/*' - 'spec/**/*'
......
This diff is collapsed.
...@@ -361,10 +361,10 @@ group :development, :test do ...@@ -361,10 +361,10 @@ group :development, :test do
gem 'spring', '~> 2.0.0' gem 'spring', '~> 2.0.0'
gem 'spring-commands-rspec', '~> 1.0.4' gem 'spring-commands-rspec', '~> 1.0.4'
gem 'gitlab-styles', '~> 3.2.0', require: false gem 'gitlab-styles', '~> 4.2.0', require: false
# Pin these dependencies, otherwise a new rule could break the CI pipelines # Pin these dependencies, otherwise a new rule could break the CI pipelines
gem 'rubocop', '~> 0.74.0' gem 'rubocop', '~> 0.82.0'
gem 'rubocop-performance', '~> 1.4.1' gem 'rubocop-performance', '~> 1.5.2'
gem 'rubocop-rspec', '~> 1.37.0' gem 'rubocop-rspec', '~> 1.37.0'
gem 'scss_lint', '~> 0.56.0', require: false gem 'scss_lint', '~> 0.56.0', require: false
......
...@@ -400,11 +400,11 @@ GEM ...@@ -400,11 +400,11 @@ GEM
gitlab-puma (>= 2.7, < 5) gitlab-puma (>= 2.7, < 5)
gitlab-sidekiq-fetcher (0.5.2) gitlab-sidekiq-fetcher (0.5.2)
sidekiq (~> 5) sidekiq (~> 5)
gitlab-styles (3.2.0) gitlab-styles (4.2.0)
rubocop (~> 0.74.0) rubocop (~> 0.82.0)
rubocop-gitlab-security (~> 0.1.0) rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.4.1) rubocop-performance (~> 1.5.2)
rubocop-rails (~> 2.0) rubocop-rails (~> 2.5)
rubocop-rspec (~> 1.36) rubocop-rspec (~> 1.36)
gitlab_chronic_duration (0.10.6.2) gitlab_chronic_duration (0.10.6.2)
numerizer (~> 0.2) numerizer (~> 0.2)
...@@ -748,7 +748,7 @@ GEM ...@@ -748,7 +748,7 @@ GEM
orm_adapter (0.5.0) orm_adapter (0.5.0)
os (1.0.0) os (1.0.0)
parallel (1.19.1) parallel (1.19.1)
parser (2.7.0.4) parser (2.7.1.2)
ast (~> 2.4.0) ast (~> 2.4.0)
parslet (1.8.2) parslet (1.8.2)
peek (1.1.0) peek (1.1.0)
...@@ -886,6 +886,7 @@ GEM ...@@ -886,6 +886,7 @@ GEM
mime-types (>= 1.16, < 4.0) mime-types (>= 1.16, < 4.0)
netrc (~> 0.8) netrc (~> 0.8)
retriable (3.1.2) retriable (3.1.2)
rexml (3.2.4)
rinku (2.0.0) rinku (2.0.0)
rotp (2.1.2) rotp (2.1.2)
rouge (3.19.0) rouge (3.19.0)
...@@ -929,18 +930,20 @@ GEM ...@@ -929,18 +930,20 @@ GEM
pg pg
rails rails
sqlite3 sqlite3
rubocop (0.74.0) rubocop (0.82.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 2.0)
rubocop-gitlab-security (0.1.1) rubocop-gitlab-security (0.1.1)
rubocop (>= 0.51) rubocop (>= 0.51)
rubocop-performance (1.4.1) rubocop-performance (1.5.2)
rubocop (>= 0.71.0) rubocop (>= 0.71.0)
rubocop-rails (2.4.0) rubocop-rails (2.5.2)
activesupport
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 0.72.0) rubocop (>= 0.72.0)
rubocop-rspec (1.37.0) rubocop-rspec (1.37.0)
...@@ -1081,7 +1084,7 @@ GEM ...@@ -1081,7 +1084,7 @@ GEM
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.5) unf_ext (0.0.7.5)
unicode-display_width (1.6.0) unicode-display_width (1.7.0)
unicode_plot (0.0.4) unicode_plot (0.0.4)
enumerable-statistics (>= 2.0.1) enumerable-statistics (>= 2.0.1)
unicode_utils (1.4.0) unicode_utils (1.4.0)
...@@ -1243,7 +1246,7 @@ DEPENDENCIES ...@@ -1243,7 +1246,7 @@ DEPENDENCIES
gitlab-puma (~> 4.3.3.gitlab.2) gitlab-puma (~> 4.3.3.gitlab.2)
gitlab-puma_worker_killer (~> 0.1.1.gitlab.1) gitlab-puma_worker_killer (~> 0.1.1.gitlab.1)
gitlab-sidekiq-fetcher (= 0.5.2) gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 3.2.0) gitlab-styles (~> 4.2.0)
gitlab_chronic_duration (~> 0.10.6.2) gitlab_chronic_duration (~> 0.10.6.2)
gitlab_omniauth-ldap (~> 2.1.1) gitlab_omniauth-ldap (~> 2.1.1)
gon (~> 6.2) gon (~> 6.2)
...@@ -1355,8 +1358,8 @@ DEPENDENCIES ...@@ -1355,8 +1358,8 @@ DEPENDENCIES
rspec-retry (~> 0.6.1) rspec-retry (~> 0.6.1)
rspec_junit_formatter rspec_junit_formatter
rspec_profiling (~> 0.0.5) rspec_profiling (~> 0.0.5)
rubocop (~> 0.74.0) rubocop (~> 0.82.0)
rubocop-performance (~> 1.4.1) rubocop-performance (~> 1.5.2)
rubocop-rspec (~> 1.37.0) rubocop-rspec (~> 1.37.0)
ruby-fogbugz (~> 0.2.1) ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 1.3.0) ruby-prof (~> 1.3.0)
......
...@@ -757,13 +757,13 @@ module Ci ...@@ -757,13 +757,13 @@ module Ci
# and use that for `ExpireBuildInstanceArtifactsWorker`? # and use that for `ExpireBuildInstanceArtifactsWorker`?
def erase_erasable_artifacts! def erase_erasable_artifacts!
job_artifacts.erasable.destroy_all # rubocop: disable DestroyAll job_artifacts.erasable.destroy_all # rubocop: disable Cop/DestroyAll
end end
def erase(opts = {}) def erase(opts = {})
return false unless erasable? return false unless erasable?
job_artifacts.destroy_all # rubocop: disable DestroyAll job_artifacts.destroy_all # rubocop: disable Cop/DestroyAll
erase_trace! erase_trace!
update_erased!(opts[:erased_by]) update_erased!(opts[:erased_by])
end end
......
...@@ -44,13 +44,13 @@ class LfsObject < ApplicationRecord ...@@ -44,13 +44,13 @@ class LfsObject < ApplicationRecord
file_store == LfsObjectUploader::Store::LOCAL file_store == LfsObjectUploader::Store::LOCAL
end end
# rubocop: disable DestroyAll # rubocop: disable Cop/DestroyAll
def self.destroy_unreferenced def self.destroy_unreferenced
joins("LEFT JOIN lfs_objects_projects ON lfs_objects_projects.lfs_object_id = #{table_name}.id") joins("LEFT JOIN lfs_objects_projects ON lfs_objects_projects.lfs_object_id = #{table_name}.id")
.where(lfs_objects_projects: { id: nil }) .where(lfs_objects_projects: { id: nil })
.destroy_all .destroy_all
end end
# rubocop: enable DestroyAll # rubocop: enable Cop/DestroyAll
def self.calculate_oid(path) def self.calculate_oid(path)
self.hexdigest(path) self.hexdigest(path)
......
...@@ -718,7 +718,7 @@ class User < ApplicationRecord ...@@ -718,7 +718,7 @@ class User < ApplicationRecord
otp_grace_period_started_at: nil, otp_grace_period_started_at: nil,
otp_backup_codes: nil otp_backup_codes: nil
) )
self.u2f_registrations.destroy_all # rubocop: disable DestroyAll self.u2f_registrations.destroy_all # rubocop: disable Cop/DestroyAll
end end
end end
......
...@@ -13,7 +13,7 @@ module AwardEmojis ...@@ -13,7 +13,7 @@ module AwardEmojis
return error("User has not awarded emoji of type #{name} on the awardable", status: :forbidden) return error("User has not awarded emoji of type #{name} on the awardable", status: :forbidden)
end end
award = awards.destroy_all.first # rubocop: disable DestroyAll award = awards.destroy_all.first # rubocop: disable Cop/DestroyAll
after_destroy(award) after_destroy(award)
success(award: award) success(award: award)
......
...@@ -90,7 +90,7 @@ module Labels ...@@ -90,7 +90,7 @@ module Labels
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def destroy_project_labels(label_ids) def destroy_project_labels(label_ids)
Label.where(id: label_ids).destroy_all # rubocop: disable DestroyAll Label.where(id: label_ids).destroy_all # rubocop: disable Cop/DestroyAll
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
...@@ -76,7 +76,7 @@ module Milestones ...@@ -76,7 +76,7 @@ module Milestones
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def destroy_old_milestones(milestone) def destroy_old_milestones(milestone)
Milestone.where(id: milestone_ids_for_merge(milestone)).destroy_all # rubocop: disable DestroyAll Milestone.where(id: milestone_ids_for_merge(milestone)).destroy_all # rubocop: disable Cop/DestroyAll
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
...@@ -4,7 +4,7 @@ module Pages ...@@ -4,7 +4,7 @@ module Pages
class DeleteService < BaseService class DeleteService < BaseService
def execute def execute
project.remove_pages project.remove_pages
project.pages_domains.destroy_all # rubocop: disable DestroyAll project.pages_domains.destroy_all # rubocop: disable Cop/DestroyAll
end end
end end
end end
...@@ -28,7 +28,7 @@ module Projects ...@@ -28,7 +28,7 @@ module Projects
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def remove_remaining_deploy_keys_projects def remove_remaining_deploy_keys_projects
source_project.deploy_keys_projects.destroy_all # rubocop: disable DestroyAll source_project.deploy_keys_projects.destroy_all # rubocop: disable Cop/DestroyAll
end end
end end
end end
...@@ -20,7 +20,7 @@ module Projects ...@@ -20,7 +20,7 @@ module Projects
end end
def remove_remaining_lfs_objects_project def remove_remaining_lfs_objects_project
source_project.lfs_objects_projects.destroy_all # rubocop: disable DestroyAll source_project.lfs_objects_projects.destroy_all # rubocop: disable Cop/DestroyAll
end end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
......
...@@ -21,7 +21,7 @@ module Projects ...@@ -21,7 +21,7 @@ module Projects
# Remove remaining notification settings from source_project # Remove remaining notification settings from source_project
def remove_remaining_notification_settings def remove_remaining_notification_settings
source_project.notification_settings.destroy_all # rubocop: disable DestroyAll source_project.notification_settings.destroy_all # rubocop: disable Cop/DestroyAll
end end
# Get users of current notification_settings # Get users of current notification_settings
......
...@@ -25,7 +25,7 @@ module Projects ...@@ -25,7 +25,7 @@ module Projects
# Remove remaining project group links from source_project # Remove remaining project group links from source_project
def remove_remaining_project_group_links def remove_remaining_project_group_links
source_project.reset.project_group_links.destroy_all # rubocop: disable DestroyAll source_project.reset.project_group_links.destroy_all # rubocop: disable Cop/DestroyAll
end end
def group_links_in_target_project def group_links_in_target_project
......
...@@ -25,7 +25,7 @@ module Projects ...@@ -25,7 +25,7 @@ module Projects
def remove_remaining_members def remove_remaining_members
# Remove remaining members and authorizations from source_project # Remove remaining members and authorizations from source_project
source_project.project_members.destroy_all # rubocop: disable DestroyAll source_project.project_members.destroy_all # rubocop: disable Cop/DestroyAll
end end
def project_members_in_target_project def project_members_in_target_project
......
...@@ -39,11 +39,11 @@ module ProtectedBranches ...@@ -39,11 +39,11 @@ module ProtectedBranches
def delete_redundant_access_levels def delete_redundant_access_levels
unless developers_can_merge.nil? unless developers_can_merge.nil?
protected_branch.merge_access_levels.destroy_all # rubocop: disable DestroyAll protected_branch.merge_access_levels.destroy_all # rubocop: disable Cop/DestroyAll
end end
unless developers_can_push.nil? unless developers_can_push.nil?
protected_branch.push_access_levels.destroy_all # rubocop: disable DestroyAll protected_branch.push_access_levels.destroy_all # rubocop: disable Cop/DestroyAll
end end
end end
end end
......
...@@ -19,7 +19,7 @@ module Snippets ...@@ -19,7 +19,7 @@ module Snippets
user_can_delete_snippets! user_can_delete_snippets!
attempt_delete_repositories! attempt_delete_repositories!
snippets.destroy_all # rubocop: disable DestroyAll snippets.destroy_all # rubocop: disable Cop/DestroyAll
ServiceResponse.success(message: 'Snippets were deleted.') ServiceResponse.success(message: 'Snippets were deleted.')
rescue SnippetAccessError rescue SnippetAccessError
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
%li %li
%span.light Current sign-in IP: %span.light Current sign-in IP:
%strong %strong
- if @user.current_sign_in_ip - if @user.current_sign_in_ip # rubocop:disable Style/RedundantCondition
= @user.current_sign_in_ip = @user.current_sign_in_ip
- else - else
never never
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
%li %li
%span.light Last sign-in IP: %span.light Last sign-in IP:
%strong %strong
- if @user.last_sign_in_ip - if @user.last_sign_in_ip # rubocop:disable Style/RedundantCondition
= @user.last_sign_in_ip = @user.last_sign_in_ip
- else - else
never never
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
- elsif type == 'checkbox' - elsif type == 'checkbox'
= form.check_box name = form.check_box name
- elsif type == 'select' - elsif type == 'select'
= form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control"} = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control"} # rubocop:disable Style/RedundantCondition
- elsif type == 'password' - elsif type == 'password'
= form.password_field name, autocomplete: "new-password", placeholder: placeholder, class: "form-control", required: value.blank? && required, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" } = form.password_field name, autocomplete: "new-password", placeholder: placeholder, class: "form-control", required: value.blank? && required, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" }
- if help - if help
......
...@@ -7,7 +7,7 @@ class RemoveExpiredGroupLinksWorker # rubocop:disable Scalability/IdempotentWork ...@@ -7,7 +7,7 @@ class RemoveExpiredGroupLinksWorker # rubocop:disable Scalability/IdempotentWork
feature_category :authentication_and_authorization feature_category :authentication_and_authorization
def perform def perform
ProjectGroupLink.expired.destroy_all # rubocop: disable DestroyAll ProjectGroupLink.expired.destroy_all # rubocop: disable Cop/DestroyAll
GroupGroupLink.expired.find_in_batches do |link_batch| GroupGroupLink.expired.find_in_batches do |link_batch|
Groups::GroupLinks::DestroyService.new(nil, nil).execute(link_batch) Groups::GroupLinks::DestroyService.new(nil, nil).execute(link_batch)
......
require_relative '../migrate/20180223120443_create_user_interacted_projects_table.rb' require_relative '../migrate/20180223120443_create_user_interacted_projects_table.rb'
# rubocop:disable AddIndex # rubocop:disable Migration/AddIndex
# rubocop:disable AddConcurrentForeignKey # rubocop:disable Migration/AddConcurrentForeignKey
class BuildUserInteractedProjectsTable < ActiveRecord::Migration[4.2] class BuildUserInteractedProjectsTable < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
......
...@@ -29,7 +29,7 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController ...@@ -29,7 +29,7 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def destroy def destroy
@group.ldap_group_links.where(id: params[:id]).destroy_all # rubocop: disable DestroyAll @group.ldap_group_links.where(id: params[:id]).destroy_all # rubocop: disable Cop/DestroyAll
redirect_back_or_default(default: { action: 'index' }, options: { notice: 'LDAP link removed' }) redirect_back_or_default(default: { action: 'index' }, options: { notice: 'LDAP link removed' })
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
...@@ -12,8 +12,8 @@ module EE ...@@ -12,8 +12,8 @@ module EE
return unless group.present? && project.present? return unless group.present? && project.present?
# For protected branches # For protected branches
project.protected_branches.merge_access_by_group(group).destroy_all # rubocop: disable DestroyAll project.protected_branches.merge_access_by_group(group).destroy_all # rubocop: disable Cop/DestroyAll
project.protected_branches.push_access_by_group(group).destroy_all # rubocop: disable DestroyAll project.protected_branches.push_access_by_group(group).destroy_all # rubocop: disable Cop/DestroyAll
# For protected tags # For protected tags
project.protected_tags.create_access_by_group(group).delete_all project.protected_tags.create_access_by_group(group).delete_all
......
...@@ -19,8 +19,8 @@ module EE ...@@ -19,8 +19,8 @@ module EE
def delete_member_branch_protection def delete_member_branch_protection
if user.present? && project.present? if user.present? && project.present?
project.protected_branches.merge_access_by_user(user).destroy_all # rubocop: disable DestroyAll project.protected_branches.merge_access_by_user(user).destroy_all # rubocop: disable Cop/DestroyAll
project.protected_branches.push_access_by_user(user).destroy_all # rubocop: disable DestroyAll project.protected_branches.push_access_by_user(user).destroy_all # rubocop: disable Cop/DestroyAll
end end
end end
......
...@@ -10,8 +10,8 @@ module CleanupApprovers ...@@ -10,8 +10,8 @@ module CleanupApprovers
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def cleanup_approvers(target, reload: false) def cleanup_approvers(target, reload: false)
target.approvers.where.not(user_id: params[:approver_ids]).destroy_all # rubocop: disable DestroyAll target.approvers.where.not(user_id: params[:approver_ids]).destroy_all # rubocop: disable Cop/DestroyAll
target.approver_groups.where.not(group_id: params[:approver_group_ids]).destroy_all # rubocop: disable DestroyAll target.approver_groups.where.not(group_id: params[:approver_group_ids]).destroy_all # rubocop: disable Cop/DestroyAll
# If the target already has `approvers` and/or `approver_groups` loaded then we need to # If the target already has `approvers` and/or `approver_groups` loaded then we need to
# force a reload in order to not return stale information after the destroys above # force a reload in order to not return stale information after the destroys above
......
...@@ -14,18 +14,18 @@ module EE ...@@ -14,18 +14,18 @@ module EE
def delete_redundant_access_levels def delete_redundant_access_levels
case developers_can_merge case developers_can_merge
when true when true
protected_branch.merge_access_levels.developer.destroy_all # rubocop: disable DestroyAll protected_branch.merge_access_levels.developer.destroy_all # rubocop: disable Cop/DestroyAll
when false when false
protected_branch.merge_access_levels.developer.destroy_all # rubocop: disable DestroyAll protected_branch.merge_access_levels.developer.destroy_all # rubocop: disable Cop/DestroyAll
protected_branch.merge_access_levels.maintainer.destroy_all # rubocop: disable DestroyAll protected_branch.merge_access_levels.maintainer.destroy_all # rubocop: disable Cop/DestroyAll
end end
case developers_can_push case developers_can_push
when true when true
protected_branch.push_access_levels.developer.destroy_all # rubocop: disable DestroyAll protected_branch.push_access_levels.developer.destroy_all # rubocop: disable Cop/DestroyAll
when false when false
protected_branch.push_access_levels.developer.destroy_all # rubocop: disable DestroyAll protected_branch.push_access_levels.developer.destroy_all # rubocop: disable Cop/DestroyAll
protected_branch.push_access_levels.maintainer.destroy_all # rubocop: disable DestroyAll protected_branch.push_access_levels.maintainer.destroy_all # rubocop: disable Cop/DestroyAll
end end
end end
end end
......
...@@ -11,7 +11,7 @@ module MergeRequests ...@@ -11,7 +11,7 @@ module MergeRequests
currently_approved = merge_request.approved? currently_approved = merge_request.approved?
if approval.destroy_all # rubocop: disable DestroyAll if approval.destroy_all # rubocop: disable Cop/DestroyAll
merge_request.reset_approval_cache! merge_request.reset_approval_cache!
create_note(merge_request) create_note(merge_request)
......
...@@ -50,7 +50,7 @@ describe Projects::Settings::IntegrationsController do ...@@ -50,7 +50,7 @@ describe Projects::Settings::IntegrationsController do
context 'without a license key' do context 'without a license key' do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
end end
it_behaves_like 'endpoint with some disabled services' it_behaves_like 'endpoint with some disabled services'
......
...@@ -12,7 +12,7 @@ describe "Admin uploads license" do ...@@ -12,7 +12,7 @@ describe "Admin uploads license" do
context "when license key is provided in the query string" do context "when license key is provided in the query string" do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
visit(admin_license_path(trial_key: license.data)) visit(admin_license_path(trial_key: license.data))
...@@ -43,7 +43,7 @@ describe "Admin uploads license" do ...@@ -43,7 +43,7 @@ describe "Admin uploads license" do
context "when license key is not provided in the query string, as it is a repeat trial" do context "when license key is not provided in the query string, as it is a repeat trial" do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
visit(admin_license_path(trial_key: "")) visit(admin_license_path(trial_key: ""))
end end
......
...@@ -171,7 +171,7 @@ describe Gitlab::Database::LoadBalancing do ...@@ -171,7 +171,7 @@ describe Gitlab::Database::LoadBalancing do
context 'without a license' do context 'without a license' do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
end end
it 'is disabled' do it 'is disabled' do
......
...@@ -112,7 +112,7 @@ describe Burndown do ...@@ -112,7 +112,7 @@ describe Burndown do
context "when all closed issues do not have closed events" do context "when all closed issues do not have closed events" do
before do before do
Event.where(target: milestone.issues, action: :closed).destroy_all # rubocop: disable DestroyAll Event.where(target: milestone.issues, action: :closed).destroy_all # rubocop: disable Cop/DestroyAll
end end
it "considers closed_at as milestone start date" do it "considers closed_at as milestone start date" do
...@@ -137,7 +137,7 @@ describe Burndown do ...@@ -137,7 +137,7 @@ describe Burndown do
context "when one but not all closed issues does not have a closed event" do context "when one but not all closed issues does not have a closed event" do
it "sets attribute accurate to false" do it "sets attribute accurate to false" do
Event.where(target: milestone.issues.closed.first, action: :closed).destroy_all # rubocop: disable DestroyAll Event.where(target: milestone.issues.closed.first, action: :closed).destroy_all # rubocop: disable Cop/DestroyAll
burndown = described_class.new(milestone.issues_visible_to_user(user), milestone.start_date, milestone.due_date) burndown = described_class.new(milestone.issues_visible_to_user(user), milestone.start_date, milestone.due_date)
aggregate_failures do aggregate_failures do
......
...@@ -175,7 +175,7 @@ describe JenkinsService do ...@@ -175,7 +175,7 @@ describe JenkinsService do
context 'without a license key' do context 'without a license key' do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
end end
it_behaves_like 'project with disabled Jenkins service' it_behaves_like 'project with disabled Jenkins service'
......
...@@ -703,7 +703,7 @@ describe GroupPolicy do ...@@ -703,7 +703,7 @@ describe GroupPolicy do
nested_group.add_guest(developer) nested_group.add_guest(developer)
nested_group.add_guest(maintainer) nested_group.add_guest(maintainer)
group.owners.destroy_all # rubocop: disable DestroyAll group.owners.destroy_all # rubocop: disable Cop/DestroyAll
group.add_guest(owner) group.add_guest(owner)
nested_group.add_owner(owner) nested_group.add_owner(owner)
......
...@@ -134,7 +134,7 @@ describe MergeRequests::UpdateService, :mailer do ...@@ -134,7 +134,7 @@ describe MergeRequests::UpdateService, :mailer do
update_merge_request(approver_ids: [existing_approver, removed_approver].map(&:id).join(',')) update_merge_request(approver_ids: [existing_approver, removed_approver].map(&:id).join(','))
end end
Todo.where(action: Todo::APPROVAL_REQUIRED).destroy_all # rubocop: disable DestroyAll Todo.where(action: Todo::APPROVAL_REQUIRED).destroy_all # rubocop: disable Cop/DestroyAll
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
end end
......
...@@ -17,7 +17,7 @@ RSpec.configure do |config| ...@@ -17,7 +17,7 @@ RSpec.configure do |config|
end end
config.before(:all) do config.before(:all) do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
TestLicense.init TestLicense.init
end end
......
...@@ -32,7 +32,7 @@ describe HistoricalDataWorker do ...@@ -32,7 +32,7 @@ describe HistoricalDataWorker do
context 'when there is not a license key' do context 'when there is not a license key' do
it 'does not track historical data' do it 'does not track historical data' do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
expect(HistoricalData).not_to receive(:track!) expect(HistoricalData).not_to receive(:track!)
......
...@@ -21,7 +21,7 @@ describe LdapAllGroupsSyncWorker do ...@@ -21,7 +21,7 @@ describe LdapAllGroupsSyncWorker do
context 'without a license key' do context 'without a license key' do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
end end
it 'does not sync all groups' do it 'does not sync all groups' do
......
...@@ -37,7 +37,7 @@ describe LdapGroupSyncWorker do ...@@ -37,7 +37,7 @@ describe LdapGroupSyncWorker do
context 'without a license key' do context 'without a license key' do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
end end
it 'does not sync groups' do it 'does not sync groups' do
......
...@@ -23,7 +23,7 @@ describe LdapSyncWorker do ...@@ -23,7 +23,7 @@ describe LdapSyncWorker do
context 'without a license key' do context 'without a license key' do
before do before do
License.destroy_all # rubocop: disable DestroyAll License.destroy_all # rubocop: disable Cop/DestroyAll
end end
it 'does not sync LDAP users' do it 'does not sync LDAP users' do
......
...@@ -15,7 +15,7 @@ Metrics/AbcSize: ...@@ -15,7 +15,7 @@ Metrics/AbcSize:
Metrics/PerceivedComplexity: Metrics/PerceivedComplexity:
Enabled: true Enabled: true
Metrics/LineLength: Layout/LineLength:
Enabled: true Enabled: true
Details: > Details: >
Long lines are very hard to read and make it more difficult to review Long lines are very hard to read and make it more difficult to review
......
...@@ -49,7 +49,7 @@ module Gitlab ...@@ -49,7 +49,7 @@ module Gitlab
def ensure_default_member! def ensure_default_member!
return if user_already_member? return if user_already_member?
@importable.members.destroy_all # rubocop: disable DestroyAll @importable.members.destroy_all # rubocop: disable Cop/DestroyAll
relation_class.create!(user: @user, access_level: highest_access_level, source_id: @importable.id, importing: true) relation_class.create!(user: @user, access_level: highest_access_level, source_id: @importable.id, importing: true)
rescue => e rescue => e
......
...@@ -212,7 +212,7 @@ describe OmniauthCallbacksController, type: :controller do ...@@ -212,7 +212,7 @@ describe OmniauthCallbacksController, type: :controller do
end end
it 'allows linking the disabled provider' do it 'allows linking the disabled provider' do
user.identities.destroy_all # rubocop: disable DestroyAll user.identities.destroy_all # rubocop: disable Cop/DestroyAll
sign_in(user) sign_in(user)
expect { post provider }.to change { user.reload.identities.count }.by(1) expect { post provider }.to change { user.reload.identities.count }.by(1)
......
...@@ -16,7 +16,7 @@ describe Projects::Tags::ReleasesController do ...@@ -16,7 +16,7 @@ describe Projects::Tags::ReleasesController do
describe 'GET #edit' do describe 'GET #edit' do
it 'initializes a new release' do it 'initializes a new release' do
tag_id = release.tag tag_id = release.tag
project.releases.destroy_all # rubocop: disable DestroyAll project.releases.destroy_all # rubocop: disable Cop/DestroyAll
response = get :edit, params: { namespace_id: project.namespace, project_id: project, tag_id: tag_id } response = get :edit, params: { namespace_id: project.namespace, project_id: project, tag_id: tag_id }
......
...@@ -15,7 +15,7 @@ describe Gitlab::Import::MergeRequestCreator do ...@@ -15,7 +15,7 @@ describe Gitlab::Import::MergeRequestCreator do
it 'updates the data' do it 'updates the data' do
commits_count = commits.count commits_count = commits.count
merge_request.merge_request_diffs.destroy_all # rubocop: disable DestroyAll merge_request.merge_request_diffs.destroy_all # rubocop: disable Cop/DestroyAll
expect(merge_request.merge_request_diffs.count).to eq(0) expect(merge_request.merge_request_diffs.count).to eq(0)
......
...@@ -33,7 +33,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do ...@@ -33,7 +33,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do
expect(subjects.count).to be > 0 expect(subjects.count).to be > 0
expect { subjects.first.destroy }.to raise_error('`destroy` and `destroy_all` are forbidden. Please use `fast_destroy_all`') expect { subjects.first.destroy }.to raise_error('`destroy` and `destroy_all` are forbidden. Please use `fast_destroy_all`')
expect { subjects.destroy_all }.to raise_error('`destroy` and `destroy_all` are forbidden. Please use `fast_destroy_all`') # rubocop: disable DestroyAll expect { subjects.destroy_all }.to raise_error('`destroy` and `destroy_all` are forbidden. Please use `fast_destroy_all`') # rubocop: disable Cop/DestroyAll
expect(subjects.count).to be > 0 expect(subjects.count).to be > 0
expect(external_data_counter).to be > 0 expect(external_data_counter).to be > 0
......
...@@ -13,7 +13,7 @@ describe ForkNetworkMember do ...@@ -13,7 +13,7 @@ describe ForkNetworkMember do
let(:fork_network) { fork_network_member.fork_network } let(:fork_network) { fork_network_member.fork_network }
it 'removes the fork network if it was the last member' do it 'removes the fork network if it was the last member' do
fork_network.fork_network_members.destroy_all # rubocop: disable DestroyAll fork_network.fork_network_members.destroy_all # rubocop: disable Cop/DestroyAll
expect(ForkNetwork.count).to eq(0) expect(ForkNetwork.count).to eq(0)
end end
......
...@@ -75,7 +75,7 @@ describe SystemHook do ...@@ -75,7 +75,7 @@ describe SystemHook do
it "project member destroy hook" do it "project member destroy hook" do
project.add_maintainer(user) project.add_maintainer(user)
project.project_members.destroy_all # rubocop: disable DestroyAll project.project_members.destroy_all # rubocop: disable Cop/DestroyAll
expect(WebMock).to have_requested(:post, system_hook.url).with( expect(WebMock).to have_requested(:post, system_hook.url).with(
body: /user_remove_from_team/, body: /user_remove_from_team/,
...@@ -121,7 +121,7 @@ describe SystemHook do ...@@ -121,7 +121,7 @@ describe SystemHook do
it 'group member destroy hook' do it 'group member destroy hook' do
group.add_maintainer(user) group.add_maintainer(user)
group.group_members.destroy_all # rubocop: disable DestroyAll group.group_members.destroy_all # rubocop: disable Cop/DestroyAll
expect(WebMock).to have_requested(:post, system_hook.url).with( expect(WebMock).to have_requested(:post, system_hook.url).with(
body: /user_remove_from_group/, body: /user_remove_from_group/,
......
...@@ -2623,7 +2623,7 @@ describe MergeRequest do ...@@ -2623,7 +2623,7 @@ describe MergeRequest do
context 'with no discussions' do context 'with no discussions' do
before do before do
merge_request.notes.destroy_all # rubocop: disable DestroyAll merge_request.notes.destroy_all # rubocop: disable Cop/DestroyAll
end end
it 'returns true' do it 'returns true' do
......
...@@ -60,7 +60,7 @@ describe ProjectGroupLink do ...@@ -60,7 +60,7 @@ describe ProjectGroupLink do
project.project_group_links.create(group: group) project.project_group_links.create(group: group)
group_users.each { |user| expect(user.authorized_projects).to include(project) } group_users.each { |user| expect(user.authorized_projects).to include(project) }
project.project_group_links.destroy_all # rubocop: disable DestroyAll project.project_group_links.destroy_all # rubocop: disable Cop/DestroyAll
group_users.each { |user| expect(user.authorized_projects).not_to include(project) } group_users.each { |user| expect(user.authorized_projects).not_to include(project) }
end end
end end
......
...@@ -175,7 +175,7 @@ describe GroupPolicy do ...@@ -175,7 +175,7 @@ describe GroupPolicy do
nested_group.add_guest(developer) nested_group.add_guest(developer)
nested_group.add_guest(maintainer) nested_group.add_guest(maintainer)
group.owners.destroy_all # rubocop: disable DestroyAll group.owners.destroy_all # rubocop: disable Cop/DestroyAll
group.add_guest(owner) group.add_guest(owner)
nested_group.add_owner(owner) nested_group.add_owner(owner)
......
...@@ -11,7 +11,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do ...@@ -11,7 +11,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
context 'when using ActiveRecord::Base' do context 'when using ActiveRecord::Base' do
it 'registers an offense on reload usage' do it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
users = User.all users = User.all
users.reload users.reload
^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218. ^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218.
...@@ -19,7 +19,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do ...@@ -19,7 +19,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
end end
it 'does not register an offense on reset usage' do it 'does not register an offense on reset usage' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
users = User.all users = User.all
users.reset users.reset
PATTERN PATTERN
...@@ -28,7 +28,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do ...@@ -28,7 +28,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
context 'when using ActiveRecord::Relation' do context 'when using ActiveRecord::Relation' do
it 'registers an offense on reload usage' do it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
user = User.new user = User.new
user.reload user.reload
^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218. ^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218.
...@@ -36,7 +36,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do ...@@ -36,7 +36,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
end end
it 'does not register an offense on reset usage' do it 'does not register an offense on reset usage' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
user = User.new user = User.new
user.reset user.reset
PATTERN PATTERN
...@@ -45,14 +45,14 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do ...@@ -45,14 +45,14 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
context 'when using on self' do context 'when using on self' do
it 'registers an offense on reload usage' do it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
reload reload
^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218. ^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218.
PATTERN PATTERN
end end
it 'does not register an offense on reset usage' do it 'does not register an offense on reset usage' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
reset reset
PATTERN PATTERN
end end
......
...@@ -14,14 +14,14 @@ describe RuboCop::Cop::AvoidRouteRedirectLeadingSlash do ...@@ -14,14 +14,14 @@ describe RuboCop::Cop::AvoidRouteRedirectLeadingSlash do
end end
it 'registers an offense when redirect has a leading slash' do it 'registers an offense when redirect has a leading slash' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
root to: redirect("/-/route") root to: redirect("/-/route")
^^^^^^^^^^^^^^^^^^^^ Do not use a leading "/" in route redirects ^^^^^^^^^^^^^^^^^^^^ Do not use a leading "/" in route redirects
PATTERN PATTERN
end end
it 'does not register an offense when redirect does not have a leading slash' do it 'does not register an offense when redirect does not have a leading slash' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
root to: redirect("-/route") root to: redirect("-/route")
PATTERN PATTERN
end end
......
...@@ -11,13 +11,13 @@ describe RuboCop::Cop::DestroyAll do ...@@ -11,13 +11,13 @@ describe RuboCop::Cop::DestroyAll do
subject(:cop) { described_class.new } subject(:cop) { described_class.new }
it 'flags the use of destroy_all with a send receiver' do it 'flags the use of destroy_all with a send receiver' do
inspect_source('foo.destroy_all # rubocop: disable DestroyAll') inspect_source('foo.destroy_all # rubocop: disable Cop/DestroyAll')
expect(cop.offenses.size).to eq(1) expect(cop.offenses.size).to eq(1)
end end
it 'flags the use of destroy_all with a constant receiver' do it 'flags the use of destroy_all with a constant receiver' do
inspect_source('User.destroy_all # rubocop: disable DestroyAll') inspect_source('User.destroy_all # rubocop: disable Cop/DestroyAll')
expect(cop.offenses.size).to eq(1) expect(cop.offenses.size).to eq(1)
end end
...@@ -31,7 +31,7 @@ describe RuboCop::Cop::DestroyAll do ...@@ -31,7 +31,7 @@ describe RuboCop::Cop::DestroyAll do
it 'flags the use of destroy_all with a local variable receiver' do it 'flags the use of destroy_all with a local variable receiver' do
inspect_source(<<~RUBY) inspect_source(<<~RUBY)
users = User.all users = User.all
users.destroy_all # rubocop: disable DestroyAll users.destroy_all # rubocop: disable Cop/DestroyAll
RUBY RUBY
expect(cop.offenses.size).to eq(1) expect(cop.offenses.size).to eq(1)
......
...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Gitlab::ChangeTimezone do ...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Gitlab::ChangeTimezone do
context 'Time.zone=' do context 'Time.zone=' do
it 'registers an offense with no 2nd argument' do it 'registers an offense with no 2nd argument' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
Time.zone = 'Awkland' Time.zone = 'Awkland'
^^^^^^^^^^^^^^^^^^^^^ Do not change timezone in the runtime (application or rspec), it could result in silently modifying other behavior. ^^^^^^^^^^^^^^^^^^^^^ Do not change timezone in the runtime (application or rspec), it could result in silently modifying other behavior.
PATTERN PATTERN
......
...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do ...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'Object.const_get' do context 'Object.const_get' do
it 'registers an offense with no 2nd argument' do it 'registers an offense with no 2nd argument' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
Object.const_get(:CONSTANT) Object.const_get(:CONSTANT)
^^^^^^^^^ Use inherit=false when using const_get. ^^^^^^^^^ Use inherit=false when using const_get.
PATTERN PATTERN
...@@ -24,7 +24,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do ...@@ -24,7 +24,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=false' do context 'inherit=false' do
it 'does not register an offense' do it 'does not register an offense' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
Object.const_get(:CONSTANT, false) Object.const_get(:CONSTANT, false)
PATTERN PATTERN
end end
...@@ -32,7 +32,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do ...@@ -32,7 +32,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=true' do context 'inherit=true' do
it 'registers an offense' do it 'registers an offense' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
Object.const_get(:CONSTANT, true) Object.const_get(:CONSTANT, true)
^^^^^^^^^ Use inherit=false when using const_get. ^^^^^^^^^ Use inherit=false when using const_get.
PATTERN PATTERN
...@@ -46,7 +46,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do ...@@ -46,7 +46,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'const_get for a nested class' do context 'const_get for a nested class' do
it 'registers an offense on reload usage' do it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
Nested::Blog.const_get(:CONSTANT) Nested::Blog.const_get(:CONSTANT)
^^^^^^^^^ Use inherit=false when using const_get. ^^^^^^^^^ Use inherit=false when using const_get.
PATTERN PATTERN
...@@ -58,7 +58,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do ...@@ -58,7 +58,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=false' do context 'inherit=false' do
it 'does not register an offense' do it 'does not register an offense' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
Nested::Blog.const_get(:CONSTANT, false) Nested::Blog.const_get(:CONSTANT, false)
PATTERN PATTERN
end end
...@@ -66,7 +66,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do ...@@ -66,7 +66,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=true' do context 'inherit=true' do
it 'registers an offense if inherit is true' do it 'registers an offense if inherit is true' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
Nested::Blog.const_get(:CONSTANT, true) Nested::Blog.const_get(:CONSTANT, true)
^^^^^^^^^ Use inherit=false when using const_get. ^^^^^^^^^ Use inherit=false when using const_get.
PATTERN PATTERN
......
...@@ -20,7 +20,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -20,7 +20,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
context 'Non-EE spec file' do context 'Non-EE spec file' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, full_path('spec/foo_spec.rb')) expect_no_offenses(<<~SOURCE, full_path('spec/foo_spec.rb'))
describe 'Foo' do describe 'Foo' do
end end
SOURCE SOURCE
...@@ -29,7 +29,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -29,7 +29,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
context 'Non-EE application file' do context 'Non-EE application file' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, full_path('app/models/blog_post.rb')) expect_no_offenses(<<~SOURCE, full_path('app/models/blog_post.rb'))
class BlogPost class BlogPost
end end
SOURCE SOURCE
...@@ -38,7 +38,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -38,7 +38,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
context 'EE application file' do context 'EE application file' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, full_path('ee/app/models/blog_post.rb')) expect_no_offenses(<<~SOURCE, full_path('ee/app/models/blog_post.rb'))
class BlogPost class BlogPost
end end
SOURCE SOURCE
...@@ -49,7 +49,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -49,7 +49,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
let(:spec_file_path) { full_path('ee/spec/controllers/foo_spec.rb') } let(:spec_file_path) { full_path('ee/spec/controllers/foo_spec.rb') }
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, spec_file_path) expect_no_offenses(<<~SOURCE, spec_file_path)
describe 'Foo' do describe 'Foo' do
end end
SOURCE SOURCE
...@@ -65,7 +65,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -65,7 +65,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
end end
it 'marks the describe as offending' do it 'marks the describe as offending' do
expect_offense(<<~SOURCE.strip_indent, spec_file_path) expect_offense(<<~SOURCE, spec_file_path)
describe 'Foo' do describe 'Foo' do
^^^^^^^^^^^^^^ Duplicate spec location in `ee/spec/controllers/ee/foo_spec.rb`. ^^^^^^^^^^^^^^ Duplicate spec location in `ee/spec/controllers/ee/foo_spec.rb`.
end end
...@@ -78,7 +78,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -78,7 +78,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
let(:spec_file_path) { full_path('ee/spec/controllers/ee/foo_spec.rb') } let(:spec_file_path) { full_path('ee/spec/controllers/ee/foo_spec.rb') }
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, spec_file_path) expect_no_offenses(<<~SOURCE, spec_file_path)
describe 'Foo' do describe 'Foo' do
end end
SOURCE SOURCE
...@@ -94,7 +94,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do ...@@ -94,7 +94,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
end end
it 'marks the describe as offending' do it 'marks the describe as offending' do
expect_offense(<<~SOURCE.strip_indent, spec_file_path) expect_offense(<<~SOURCE, spec_file_path)
describe 'Foo' do describe 'Foo' do
^^^^^^^^^^^^^^ Duplicate spec location in `ee/spec/controllers/foo_spec.rb`. ^^^^^^^^^^^^^^ Duplicate spec location in `ee/spec/controllers/foo_spec.rb`.
end end
......
...@@ -18,7 +18,7 @@ describe RuboCop::Cop::Migration::AddIndex do ...@@ -18,7 +18,7 @@ describe RuboCop::Cop::Migration::AddIndex do
end end
it 'registers an offense when add_index is used' do it 'registers an offense when add_index is used' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
def change def change
add_index :table, :column add_index :table, :column
^^^^^^^^^ `add_index` requires downtime, use `add_concurrent_index` instead ^^^^^^^^^ `add_index` requires downtime, use `add_concurrent_index` instead
...@@ -29,7 +29,7 @@ describe RuboCop::Cop::Migration::AddIndex do ...@@ -29,7 +29,7 @@ describe RuboCop::Cop::Migration::AddIndex do
context 'outside of migration' do context 'outside of migration' do
it 'registers no offense' do it 'registers no offense' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
def change def change
add_index :table, :column add_index :table, :column
end end
......
...@@ -14,7 +14,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do ...@@ -14,7 +14,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do
end end
it 'registers an offense when route is outside scope' do it 'registers an offense when route is outside scope' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
scope(path: 'groups/*group_id/-', module: :groups) do scope(path: 'groups/*group_id/-', module: :groups) do
resource :issues resource :issues
end end
...@@ -25,7 +25,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do ...@@ -25,7 +25,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do
end end
it 'does not register an offense when resource inside the scope' do it 'does not register an offense when resource inside the scope' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
scope(path: 'groups/*group_id/-', module: :groups) do scope(path: 'groups/*group_id/-', module: :groups) do
resource :issues resource :issues
resource :notes resource :notes
...@@ -34,7 +34,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do ...@@ -34,7 +34,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do
end end
it 'does not register an offense when resource is deep inside the scope' do it 'does not register an offense when resource is deep inside the scope' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
scope(path: 'groups/*group_id/-', module: :groups) do scope(path: 'groups/*group_id/-', module: :groups) do
resource :issues resource :issues
resource :projects do resource :projects do
......
...@@ -14,7 +14,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do ...@@ -14,7 +14,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do
end end
it 'registers an offense when route is outside scope' do it 'registers an offense when route is outside scope' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
scope '-' do scope '-' do
resource :issues resource :issues
end end
...@@ -25,7 +25,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do ...@@ -25,7 +25,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do
end end
it 'does not register an offense when resource inside the scope' do it 'does not register an offense when resource inside the scope' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
scope '-' do scope '-' do
resource :issues resource :issues
resource :notes resource :notes
...@@ -34,7 +34,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do ...@@ -34,7 +34,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do
end end
it 'does not register an offense when resource is deep inside the scope' do it 'does not register an offense when resource is deep inside the scope' do
expect_no_offenses(<<~PATTERN.strip_indent) expect_no_offenses(<<~PATTERN)
scope '-' do scope '-' do
resource :issues resource :issues
resource :projects do resource :projects do
......
...@@ -15,7 +15,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do ...@@ -15,7 +15,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the file ends in _spec.rb' do context 'when the file ends in _spec.rb' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, 'spec/foo_spec.rb') expect_no_offenses(<<~SOURCE, 'spec/foo_spec.rb')
describe 'Foo' do describe 'Foo' do
end end
SOURCE SOURCE
...@@ -24,7 +24,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do ...@@ -24,7 +24,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the file is a frontend fixture' do context 'when the file is a frontend fixture' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, 'spec/frontend/fixtures/foo.rb') expect_no_offenses(<<~SOURCE, 'spec/frontend/fixtures/foo.rb')
describe 'Foo' do describe 'Foo' do
end end
SOURCE SOURCE
...@@ -34,7 +34,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do ...@@ -34,7 +34,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the describe is in a shared example' do context 'when the describe is in a shared example' do
context 'with shared_examples' do context 'with shared_examples' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, 'spec/foo.rb') expect_no_offenses(<<~SOURCE, 'spec/foo.rb')
shared_examples 'Foo' do shared_examples 'Foo' do
describe '#bar' do describe '#bar' do
end end
...@@ -45,7 +45,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do ...@@ -45,7 +45,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'with shared_examples_for' do context 'with shared_examples_for' do
it 'registers no offenses' do it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, 'spec/foo.rb') expect_no_offenses(<<~SOURCE, 'spec/foo.rb')
shared_examples_for 'Foo' do shared_examples_for 'Foo' do
describe '#bar' do describe '#bar' do
end end
...@@ -57,7 +57,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do ...@@ -57,7 +57,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the describe is at the top level' do context 'when the describe is at the top level' do
it 'marks the describe as offending' do it 'marks the describe as offending' do
expect_offense(<<~SOURCE.strip_indent, 'spec/foo.rb') expect_offense(<<~SOURCE, 'spec/foo.rb')
describe 'Foo' do describe 'Foo' do
^^^^^^^^^^^^^^ #{described_class::MESSAGE} ^^^^^^^^^^^^^^ #{described_class::MESSAGE}
end end
......
...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do ...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
subject(:cop) { described_class.new } subject(:cop) { described_class.new }
it "adds an offense when calling bulk_perform_async" do it "adds an offense when calling bulk_perform_async" do
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
Worker.bulk_perform_async(args) Worker.bulk_perform_async(args)
CODE CODE
...@@ -20,7 +20,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do ...@@ -20,7 +20,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
end end
it "adds an offense when calling bulk_perform_in" do it "adds an offense when calling bulk_perform_in" do
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
diffs.each_batch(of: BATCH_SIZE) do |relation, index| diffs.each_batch(of: BATCH_SIZE) do |relation, index|
ids = relation.pluck_primary_key.map { |id| [id] } ids = relation.pluck_primary_key.map { |id| [id] }
DeleteDiffFilesWorker.bulk_perform_in(index * 5.minutes, ids) DeleteDiffFilesWorker.bulk_perform_in(index * 5.minutes, ids)
...@@ -33,7 +33,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do ...@@ -33,7 +33,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
it "does not add an offense for migrations" do it "does not add an offense for migrations" do
allow(cop).to receive(:in_migration?).and_return(true) allow(cop).to receive(:in_migration?).and_return(true)
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
Worker.bulk_perform_in(args) Worker.bulk_perform_in(args)
CODE CODE
...@@ -43,7 +43,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do ...@@ -43,7 +43,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
it "does not add an offence for specs" do it "does not add an offence for specs" do
allow(cop).to receive(:in_spec?).and_return(true) allow(cop).to receive(:in_spec?).and_return(true)
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
Worker.bulk_perform_in(args) Worker.bulk_perform_in(args)
CODE CODE
...@@ -51,7 +51,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do ...@@ -51,7 +51,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
end end
it "does not add an offense for scheduling BackgroundMigrations" do it "does not add an offense for scheduling BackgroundMigrations" do
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
BackgroundMigrationWorker.bulk_perform_in(args) BackgroundMigrationWorker.bulk_perform_in(args)
CODE CODE
......
...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do ...@@ -12,7 +12,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
subject(:cop) { described_class.new } subject(:cop) { described_class.new }
it 'adds an offense when including CronjobQueue' do it 'adds an offense when including CronjobQueue' do
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
class SomeWorker class SomeWorker
include CronjobQueue include CronjobQueue
end end
...@@ -22,14 +22,14 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do ...@@ -22,14 +22,14 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end end
it 'does not add offenses for other workers' do it 'does not add offenses for other workers' do
expect_no_offenses(<<~CODE.strip_indent) expect_no_offenses(<<~CODE)
class SomeWorker class SomeWorker
end end
CODE CODE
end end
it 'does not add an offense when the class defines a context' do it 'does not add an offense when the class defines a context' do
expect_no_offenses(<<~CODE.strip_indent) expect_no_offenses(<<~CODE)
class SomeWorker class SomeWorker
include CronjobQueue include CronjobQueue
...@@ -39,7 +39,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do ...@@ -39,7 +39,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end end
it 'does not add an offense when the worker calls `with_context`' do it 'does not add an offense when the worker calls `with_context`' do
expect_no_offenses(<<~CODE.strip_indent) expect_no_offenses(<<~CODE)
class SomeWorker class SomeWorker
include CronjobQueue include CronjobQueue
...@@ -53,7 +53,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do ...@@ -53,7 +53,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end end
it 'does not add an offense when the worker calls `bulk_perform_async_with_contexts`' do it 'does not add an offense when the worker calls `bulk_perform_async_with_contexts`' do
expect_no_offenses(<<~CODE.strip_indent) expect_no_offenses(<<~CODE)
class SomeWorker class SomeWorker
include CronjobQueue include CronjobQueue
...@@ -67,7 +67,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do ...@@ -67,7 +67,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end end
it 'does not add an offense when the worker calls `bulk_perform_in_with_contexts`' do it 'does not add an offense when the worker calls `bulk_perform_in_with_contexts`' do
expect_no_offenses(<<~CODE.strip_indent) expect_no_offenses(<<~CODE)
class SomeWorker class SomeWorker
include CronjobQueue include CronjobQueue
......
...@@ -15,7 +15,7 @@ describe RuboCop::Cop::Scalability::FileUploads do ...@@ -15,7 +15,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
context 'with required params' do context 'with required params' do
it 'detects File in types array' do it 'detects File in types array' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
params do params do
requires :certificate, allow_blank: false, types: [String, File] requires :certificate, allow_blank: false, types: [String, File]
^^^^ #{message} ^^^^ #{message}
...@@ -24,7 +24,7 @@ describe RuboCop::Cop::Scalability::FileUploads do ...@@ -24,7 +24,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
end end
it 'detects File as type argument' do it 'detects File as type argument' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
params do params do
requires :attachment, type: File requires :attachment, type: File
^^^^ #{message} ^^^^ #{message}
...@@ -35,7 +35,7 @@ describe RuboCop::Cop::Scalability::FileUploads do ...@@ -35,7 +35,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
context 'with optional params' do context 'with optional params' do
it 'detects File in types array' do it 'detects File in types array' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
params do params do
optional :certificate, allow_blank: false, types: [String, File] optional :certificate, allow_blank: false, types: [String, File]
^^^^ #{message} ^^^^ #{message}
...@@ -44,7 +44,7 @@ describe RuboCop::Cop::Scalability::FileUploads do ...@@ -44,7 +44,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
end end
it 'detects File as type argument' do it 'detects File as type argument' do
expect_offense(<<~PATTERN.strip_indent) expect_offense(<<~PATTERN)
params do params do
optional :attachment, type: File optional :attachment, type: File
^^^^ #{message} ^^^^ #{message}
......
...@@ -18,7 +18,7 @@ describe RuboCop::Cop::Scalability::IdempotentWorker do ...@@ -18,7 +18,7 @@ describe RuboCop::Cop::Scalability::IdempotentWorker do
end end
it 'adds an offense when not defining idempotent method' do it 'adds an offense when not defining idempotent method' do
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
class SomeWorker class SomeWorker
end end
CODE CODE
...@@ -27,7 +27,7 @@ describe RuboCop::Cop::Scalability::IdempotentWorker do ...@@ -27,7 +27,7 @@ describe RuboCop::Cop::Scalability::IdempotentWorker do
end end
it 'adds an offense when not defining idempotent method' do it 'adds an offense when not defining idempotent method' do
inspect_source(<<~CODE.strip_indent) inspect_source(<<~CODE)
class SomeWorker class SomeWorker
idempotent! idempotent!
end end
......
...@@ -136,11 +136,11 @@ describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do ...@@ -136,11 +136,11 @@ describe MergeRequests::CreateService, :clean_gitlab_redis_shared_state do
let!(:pipeline_3) { create(:ci_pipeline, project: project, ref: "other_branch", project_id: project.id) } let!(:pipeline_3) { create(:ci_pipeline, project: project, ref: "other_branch", project_id: project.id) }
before do before do
# rubocop: disable DestroyAll # rubocop: disable Cop/DestroyAll
project.merge_requests project.merge_requests
.where(source_branch: opts[:source_branch], target_branch: opts[:target_branch]) .where(source_branch: opts[:source_branch], target_branch: opts[:target_branch])
.destroy_all .destroy_all
# rubocop: enable DestroyAll # rubocop: enable Cop/DestroyAll
end end
it 'sets head pipeline' do it 'sets head pipeline' do
......
...@@ -48,12 +48,12 @@ describe MergeRequests::DeleteNonLatestDiffsService, :clean_gitlab_redis_shared_ ...@@ -48,12 +48,12 @@ describe MergeRequests::DeleteNonLatestDiffsService, :clean_gitlab_redis_shared_
end end
it 'schedules no removal if there is no non-latest diffs' do it 'schedules no removal if there is no non-latest diffs' do
# rubocop: disable DestroyAll # rubocop: disable Cop/DestroyAll
merge_request merge_request
.merge_request_diffs .merge_request_diffs
.where.not(id: merge_request.latest_merge_request_diff_id) .where.not(id: merge_request.latest_merge_request_diff_id)
.destroy_all .destroy_all
# rubocop: enable DestroyAll # rubocop: enable Cop/DestroyAll
expect(DeleteDiffFilesWorker).not_to receive(:bulk_perform_in) expect(DeleteDiffFilesWorker).not_to receive(:bulk_perform_in)
......
...@@ -8,7 +8,7 @@ describe RepositoryCheck::SingleRepositoryWorker do ...@@ -8,7 +8,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
it 'skips when the project has no push events' do it 'skips when the project has no push events' do
project = create(:project, :repository, :wiki_disabled) project = create(:project, :repository, :wiki_disabled)
project.events.destroy_all # rubocop: disable DestroyAll project.events.destroy_all # rubocop: disable Cop/DestroyAll
break_project(project) break_project(project)
expect(worker).not_to receive(:git_fsck) expect(worker).not_to receive(:git_fsck)
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'overcommit' gem 'overcommit'
gem 'gitlab-styles', '~> 3.1.0', require: false gem 'gitlab-styles', '~> 4.2.0', require: false
gem 'scss_lint', '~> 0.56.0', require: false gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.34.0', require: false gem 'haml_lint', '~> 0.34.0', require: false
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (6.0.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
ast (2.4.0) ast (2.4.0)
childprocess (3.0.0) childprocess (3.0.0)
ffi (1.12.1) concurrent-ruby (1.1.6)
gitlab-styles (3.1.0) ffi (1.12.2)
rubocop (~> 0.74.0) gitlab-styles (4.2.0)
rubocop (~> 0.82.0)
rubocop-gitlab-security (~> 0.1.0) rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.4.1) rubocop-performance (~> 1.5.2)
rubocop-rails (~> 2.0) rubocop-rails (~> 2.5)
rubocop-rspec (~> 1.36) rubocop-rspec (~> 1.36)
haml (5.1.2) haml (5.1.2)
temple (>= 0.8.0) temple (>= 0.8.0)
tilt tilt
haml_lint (0.34.1) haml_lint (0.34.0)
haml (>= 4.0, < 5.2) haml (>= 4.0, < 5.2)
rainbow rainbow
rubocop (>= 0.50.0) rubocop (>= 0.50.0)
sysexits (~> 1.1) sysexits (~> 1.1)
iniparse (1.4.4) i18n (1.8.2)
concurrent-ruby (~> 1.0)
iniparse (1.5.0)
jaro_winkler (1.5.4) jaro_winkler (1.5.4)
overcommit (0.52.1) minitest (5.11.3)
overcommit (0.53.0)
childprocess (>= 0.6.3, < 4) childprocess (>= 0.6.3, < 4)
iniparse (~> 1.4) iniparse (~> 1.4)
parallel (1.19.1) parallel (1.19.1)
parser (2.7.0.2) parser (2.7.1.2)
ast (~> 2.4.0) ast (~> 2.4.0)
rack (2.1.1) rack (2.0.9)
rainbow (3.0.0) rainbow (3.0.0)
rake (12.3.3) rake (12.3.3)
rb-fsevent (0.10.3) rb-fsevent (0.10.2)
rb-inotify (0.10.1) rb-inotify (0.9.10)
ffi (~> 1.0) ffi (>= 0.5.0, < 2)
rubocop (0.74.0) rexml (3.2.4)
rubocop (0.82.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 2.0)
rubocop-gitlab-security (0.1.1) rubocop-gitlab-security (0.1.1)
rubocop (>= 0.51) rubocop (>= 0.51)
rubocop-performance (1.4.1) rubocop-performance (1.5.2)
rubocop (>= 0.71.0) rubocop (>= 0.71.0)
rubocop-rails (2.4.1) rubocop-rails (2.5.2)
activesupport
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 0.72.0) rubocop (>= 0.72.0)
rubocop-rspec (1.37.1) rubocop-rspec (1.37.0)
rubocop (>= 0.68.1) rubocop (>= 0.68.1)
ruby-progressbar (1.10.1) ruby-progressbar (1.10.1)
sass (3.5.7) sass (3.5.5)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
sass-listen (4.0.0) sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
...@@ -59,14 +72,18 @@ GEM ...@@ -59,14 +72,18 @@ GEM
sass (~> 3.5.3) sass (~> 3.5.3)
sysexits (1.2.0) sysexits (1.2.0)
temple (0.8.2) temple (0.8.2)
thread_safe (0.3.6)
tilt (2.0.10) tilt (2.0.10)
unicode-display_width (1.6.1) tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
zeitwerk (2.3.0)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
gitlab-styles (~> 3.1.0) gitlab-styles (~> 4.2.0)
haml_lint (~> 0.34.0) haml_lint (~> 0.34.0)
overcommit overcommit
scss_lint (~> 0.56.0) scss_lint (~> 0.56.0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment