Commit 3da9f759 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '216948-upgrade-rubocop-to-0-82' into 'master'

Upgrade rubocop to 0.82

Closes #216948

See merge request gitlab-org/gitlab!32689
parents bcb69815 27d2bfdc
......@@ -80,8 +80,8 @@ linters:
ignored_cops:
- Layout/BlockAlignment
- Layout/EndAlignment
- Layout/LineLength
- Lint/Void
- Metrics/LineLength
- Naming/FileName
- Style/AlignParameters
- Style/BlockNesting
......@@ -92,7 +92,6 @@ linters:
- Style/IfUnlessModifier
- Style/IndentationWidth
- Style/Next
- Style/TrailingBlankLines
- Style/TrailingWhitespace
- Style/WhileUntilModifier
......@@ -112,7 +111,7 @@ linters:
- Layout/SpaceInsideArrayLiteralBrackets
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideStringInterpolation
- Layout/TrailingBlankLines
- Layout/TrailingEmptyLines
- Lint/BooleanSymbol
- Lint/LiteralInInterpolation
- Lint/ParenthesesAsGroupedExpression
......
# This configuration was generated by
# `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
# one by one as the lints are removed from the code base.
# Note that changes in the inspected code, or installation of new
......
......@@ -13,7 +13,7 @@ inherit_mode:
AllCops:
TargetRubyVersion: 2.6
TargetRailsVersion: 5.0
TargetRailsVersion: 6.0
Exclude:
- 'vendor/**/*'
- 'node_modules/**/*'
......@@ -186,6 +186,14 @@ Rails/FindBy:
- '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/ModuleWithInstanceVariables:
......@@ -260,7 +268,7 @@ Style/ReturnNil:
Performance/RegexpMatch:
Enabled: false
ActiveRecordAssociationReload:
Cop/ActiveRecordAssociationReload:
Enabled: true
Exclude:
- 'spec/**/*'
......
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-01-16 11:53:06 -0800 using RuboCop version 0.74.0.
# on 2020-05-20 16:32:14 -0400 using RuboCop version 0.82.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 299
# Offense count: 308
# Cop supports --auto-correct.
Capybara/CurrentPathExpectation:
Enabled: false
# Offense count: 1432
# Offense count: 1715
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_argument, with_fixed_indentation
Layout/AlignArguments:
Enabled: false
# Offense count: 1630
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/AlignHash:
Layout/ArgumentAlignment:
Enabled: false
# Offense count: 13
......@@ -41,7 +32,7 @@ Layout/ClosingHeredocIndentation:
- 'spec/rubocop/cop/active_record_association_reload_spec.rb'
- 'spec/services/task_list_toggle_service_spec.rb'
# Offense count: 9
# Offense count: 13
# Cop supports --auto-correct.
Layout/ClosingParenthesisIndentation:
Exclude:
......@@ -52,7 +43,7 @@ Layout/ClosingParenthesisIndentation:
- 'spec/support/helpers/stub_object_storage.rb'
- 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb'
# Offense count: 69
# Offense count: 72
# Cop supports --auto-correct.
Layout/EmptyLinesAroundArguments:
Exclude:
......@@ -60,46 +51,61 @@ Layout/EmptyLinesAroundArguments:
- 'app/models/concerns/resolvable_discussion.rb'
- 'app/models/diff_discussion.rb'
- 'app/models/discussion.rb'
- 'ee/app/helpers/license_helper.rb'
- 'ee/spec/models/geo/project_registry_spec.rb'
- 'lib/banzai/pipeline/broadcast_message_pipeline.rb'
- 'lib/banzai/pipeline/gfm_pipeline.rb'
- 'lib/banzai/pipeline/single_line_pipeline.rb'
- 'spec/features/markdown/copy_as_gfm_spec.rb'
# Offense count: 305
# Offense count: 413
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Layout/IndentFirstArrayElement:
Layout/FirstArrayElementIndentation:
Enabled: false
# Offense count: 1005
# Offense count: 1218
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentFirstHashElement:
Layout/FirstHashElementIndentation:
Enabled: false
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: consistent, align_parentheses
Layout/IndentFirstParameter:
Layout/FirstParameterIndentation:
Exclude:
- 'lib/gitlab/cross_project_access.rb'
- 'lib/gitlab/data_builder/push.rb'
- 'spec/support/helpers/repo_helpers.rb'
- 'spec/support/helpers/stub_object_storage.rb'
# Offense count: 54
# Offense count: 2164
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Enabled: false
# Offense count: 9396
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 1313
# Offense count: 94
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation:
Enabled: false
# Offense count: 10
# Offense count: 9
# Cop supports --auto-correct.
Layout/RescueEnsureAlignment:
Exclude:
......@@ -107,21 +113,33 @@ Layout/RescueEnsureAlignment:
- 'app/models/project.rb'
- 'app/services/prometheus/proxy_service.rb'
- 'app/workers/delete_stored_files_worker.rb'
- 'app/workers/reactive_caching_worker.rb'
- 'config/initializers/1_settings.rb'
- 'config/initializers/trusted_proxies.rb'
- 'lib/gitlab/background_migration/archive_legacy_traces.rb'
- 'lib/gitlab/highlight.rb'
- 'lib/tasks/gitlab/lfs/migrate.rake'
# Offense count: 522
# Offense count: 36
# Cop supports --auto-correct.
Layout/SpaceAroundMethodCallOperator:
Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceBeforeFirstArg:
Exclude:
- 'spec/requests/api/runner_spec.rb'
- 'spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb'
# Offense count: 642
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: require_no_space, require_space
Layout/SpaceInLambdaLiteral:
Enabled: false
# Offense count: 796
# Offense count: 926
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
......@@ -129,7 +147,7 @@ Layout/SpaceInLambdaLiteral:
Layout/SpaceInsideBlockBraces:
Enabled: false
# Offense count: 315
# Offense count: 401
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
......@@ -153,12 +171,47 @@ Lint/DuplicateMethods:
- 'lib/gitlab/git/tree.rb'
- 'lib/gitlab/git/wiki_page.rb'
# Offense count: 122
# Offense count: 157
# Configuration parameters: MaximumRangeSize.
Lint/MissingCopEnableDirective:
Enabled: false
# Offense count: 6
# Offense count: 11
# Cop supports --auto-correct.
Lint/NonDeterministicRequireOrder:
Exclude:
- 'ee/spec/spec_helper.rb'
- 'qa/spec/spec_helper.rb'
- 'spec/spec_helper.rb'
# Offense count: 3
# Configuration parameters: AllowedImplicitNamespaces.
# AllowedImplicitNamespaces: Gem
Lint/RaiseException:
Exclude:
- 'db/migrate/20190402150158_backport_enterprise_schema.rb'
- 'ee/spec/requests/api/helpers_spec.rb'
- 'spec/requests/api/helpers_spec.rb'
# Offense count: 27
# Cop supports --auto-correct.
Lint/RedundantCopDisableDirective:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
Lint/SendWithMixinArgument:
Exclude:
- 'config/initializers/trusted_proxies.rb'
# Offense count: 3
Lint/StructNewOverride:
Exclude:
- 'app/presenters/sentry_error_presenter.rb'
- 'app/serializers/environment_serializer.rb'
- 'lib/gitlab/ci/pipeline/duration.rb'
# Offense count: 7
Lint/UriEscapeUnescape:
Exclude:
- 'app/controllers/application_controller.rb'
......@@ -166,14 +219,20 @@ Lint/UriEscapeUnescape:
- 'spec/lib/google_api/auth_spec.rb'
- 'spec/requests/api/files_spec.rb'
# Offense count: 165
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 176
Lint/UriRegexp:
Exclude:
- 'app/models/concerns/mentionable/reference_regexes.rb'
- 'app/services/projects/download_service.rb'
- 'lib/gitlab/ci/pipeline/chain/config/content/remote.rb'
# Offense count: 65
# Cop supports --auto-correct.
Migration/DepartmentName:
Enabled: false
# Offense count: 143
# Offense count: 156
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
......@@ -190,43 +249,78 @@ Naming/HeredocDelimiterCase:
- 'spec/support/helpers/repo_helpers.rb'
- 'spec/support/helpers/seed_repo.rb'
# Offense count: 211
# Configuration parameters: Blacklist.
# Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
# Offense count: 239
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
Enabled: false
# Offense count: 139
# Offense count: 5
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
Naming/MethodParameterName:
Exclude:
- 'lib/gitlab/diff/inline_diff.rb'
- 'spec/support/helpers/key_generator_helper.rb'
# Offense count: 162
# Cop supports --auto-correct.
# Configuration parameters: PreferredName.
Naming/RescuedExceptionsVariableName:
Enabled: false
# Offense count: 9913
# Offense count: 20
# Cop supports --auto-correct.
Performance/Count:
Exclude:
- 'app/helpers/groups_helper.rb'
- 'app/services/merge_requests/add_context_service.rb'
- 'ee/lib/gitlab/geo/fdw.rb'
- 'ee/lib/gitlab/graphql/aggregations/epics/epic_node.rb'
- 'ee/spec/controllers/projects/feature_flags_controller_spec.rb'
- 'ee/spec/requests/api/feature_flags_spec.rb'
- 'lib/gitlab/sidekiq_status.rb'
- 'spec/lib/gitlab/conflict/file_spec.rb'
- 'spec/lib/gitlab/git/tree_spec.rb'
- 'spec/models/ci/build_spec.rb'
- 'spec/support/matchers/exceed_query_limit.rb'
# Offense count: 25
# Cop supports --auto-correct.
Performance/Detect:
Exclude:
- 'ee/spec/controllers/projects/dependencies_controller_spec.rb'
- 'ee/spec/controllers/projects/feature_flags_controller_spec.rb'
- 'ee/spec/requests/api/unleash_spec.rb'
- 'spec/lib/gitlab/git/tree_spec.rb'
- 'spec/lib/gitlab/import_export/project/tree_restorer_spec.rb'
- 'spec/models/event_spec.rb'
- 'spec/requests/api/jobs_spec.rb'
# Offense count: 11832
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false
# Offense count: 879
# Offense count: 1121
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: method_call, block
RSpec/ExpectChange:
Enabled: false
# Offense count: 660
# Offense count: 751
RSpec/ExpectInHook:
Enabled: false
# Offense count: 10
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: it_behaves_like, it_should_behave_like
RSpec/ItBehavesLike:
Exclude:
- 'spec/lib/gitlab/git/commit_spec.rb'
- 'spec/lib/gitlab/git/repository_spec.rb'
- 'spec/services/notification_service_spec.rb'
# Offense count: 68
......@@ -244,30 +338,28 @@ RSpec/LetBeforeExamples:
- 'spec/rubocop/cop/migration/update_column_in_batches_spec.rb'
- 'spec/serializers/pipeline_details_entity_spec.rb'
# Offense count: 2018
# Offense count: 2188
# Cop supports --auto-correct.
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
# SupportedStyles: inflected, explicit
RSpec/PredicateMatcher:
Enabled: false
# Offense count: 584
# Offense count: 635
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: and_return, block
RSpec/ReturnFromStub:
Enabled: false
# Offense count: 380
# Offense count: 518
RSpec/ScatteredLet:
Enabled: false
# Offense count: 8
# Offense count: 4
RSpec/ScatteredSetup:
Exclude:
- 'spec/lib/gitlab/bitbucket_import/importer_spec.rb'
- 'spec/requests/api/jobs_spec.rb'
- 'spec/services/projects/create_service_spec.rb'
# Offense count: 10
# Cop supports --auto-correct.
......@@ -284,67 +376,92 @@ Rails/ApplicationController:
- 'spec/controllers/concerns/continue_params_spec.rb'
- 'spec/lib/marginalia_spec.rb'
# Offense count: 8
# Offense count: 3
# Cop supports --auto-correct.
Rails/BelongsTo:
Exclude:
- 'app/models/deployment.rb'
- 'app/models/environment.rb'
- 'ee/app/models/prometheus_alert.rb'
- 'ee/app/models/prometheus_alert_event.rb'
# Offense count: 151
# Offense count: 71
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql, postgresql
# Include: db/migrate/*.rb
Rails/BulkChangeTable:
Enabled: false
# Offense count: 208
# Configuration parameters: Include.
# Include: db/migrate/*.rb
Rails/CreateTableWithTimestamps:
Enabled: false
# Offense count: 266
# Offense count: 346
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
Enabled: false
# Offense count: 211
# Offense count: 264
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Enabled: false
# Offense count: 431
# Offense count: 467
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
Enabled: false
# Offense count: 103
# Offense count: 15
# Cop supports --auto-correct.
Rails/IndexBy:
Exclude:
- 'app/models/ci/pipeline.rb'
- 'app/services/ci/pipeline_processing/atomic_processing_service/status_collection.rb'
- 'ee/app/services/projects/update_mirror_service.rb'
- 'ee/app/services/security/store_report_service.rb'
- 'ee/lib/ee/gitlab/auth/ldap/sync/group.rb'
- 'ee/lib/ee/gitlab/background_migration/backfill_version_data_from_gitaly.rb'
- 'ee/lib/gitlab/analytics/type_of_work/tasks_by_type.rb'
- 'ee/lib/gitlab/elastic/document_reference.rb'
- 'ee/lib/gitlab/group_plans_preloader.rb'
- 'lib/gitlab/database/count/reltuples_count_strategy.rb'
- 'lib/gitlab/language_detection.rb'
# Offense count: 36
# Cop supports --auto-correct.
Rails/IndexWith:
Enabled: false
# Offense count: 105
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/InverseOf:
Enabled: false
# Offense count: 51
# Offense count: 55
# Configuration parameters: Include.
# Include: app/controllers/**/*.rb
Rails/LexicallyScopedActionFilter:
Enabled: false
# Offense count: 4
# Offense count: 3
# Cop supports --auto-correct.
Rails/LinkToBlank:
Exclude:
- 'app/helpers/projects_helper.rb'
- 'app/helpers/wiki_helper.rb'
- 'ee/app/helpers/ee/user_callouts_helper.rb'
- 'ee/app/helpers/license_helper.rb'
# Offense count: 35
# Offense count: 34
# Configuration parameters: Include.
# Include: **/Rakefile, **/*.rake
Rails/RakeEnvironment:
Enabled: false
# Offense count: 868
# Offense count: 926
# Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
Rails/SkipsModelValidations:
......@@ -360,13 +477,18 @@ Security/YAMLLoad:
- 'spec/initializers/secret_token_spec.rb'
- 'spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb'
# Offense count: 34
# Configuration parameters: EnforcedStyle.
# Offense count: 10
# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Enabled: false
Exclude:
- 'app/helpers/issues_helper.rb'
- 'app/helpers/lazy_image_tag_helper.rb'
- 'lib/gitlab/cache/request_cache.rb'
- 'lib/gitlab/request_profiler.rb'
- 'spec/support/forgery_protection.rb'
# Offense count: 127
# Offense count: 148
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: percent_q, bare_percent
......@@ -379,7 +501,7 @@ Style/CommentedKeyword:
- 'lib/tasks/gitlab/backup.rake'
- 'spec/tasks/gitlab/backup_rake_spec.rb'
# Offense count: 6
# Offense count: 5
# Cop supports --auto-correct.
Style/EachWithObject:
Exclude:
......@@ -388,9 +510,8 @@ Style/EachWithObject:
- 'lib/gitlab/hook_data/issuable_builder.rb'
- 'lib/gitlab/i18n/po_linter.rb'
- 'lib/gitlab/import_export/members_mapper.rb'
- 'lib/gitlab/import_export/relation_factory.rb'
# Offense count: 41
# Offense count: 46
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty, nil, both
......@@ -404,7 +525,7 @@ Style/EmptyLambdaParameter:
- 'app/models/ci/build.rb'
- 'app/models/ci/runner.rb'
# Offense count: 8
# Offense count: 7
# Cop supports --auto-correct.
Style/EmptyLiteral:
Exclude:
......@@ -414,38 +535,66 @@ Style/EmptyLiteral:
- 'spec/helpers/merge_requests_helper_spec.rb'
- 'spec/lib/gitlab/workhorse_spec.rb'
- 'spec/requests/api/jobs_spec.rb'
- 'spec/support/shared_examples/chat_slash_commands_shared_examples.rb'
# Offense count: 148
# Offense count: 170
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Enabled: false
# Offense count: 346
# Offense count: 431
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: format, sprintf, percent
Style/FormatString:
Enabled: false
# Offense count: 692
# Offense count: 769
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Enabled: false
# Offense count: 27
# Offense count: 47
# Cop supports --auto-correct.
Style/HashEachMethods:
Enabled: false
# Offense count: 6
# Cop supports --auto-correct.
Style/HashTransformKeys:
Exclude:
- 'ee/app/models/vulnerabilities/occurrence.rb'
- 'ee/spec/lib/gitlab/ci/templates/dependency_scanning_gitlab_ci_yaml_spec.rb'
- 'lib/banzai/filter/commit_trailers_filter.rb'
- 'lib/gitlab/analytics/cycle_analytics/stage_events.rb'
# Offense count: 10
# Cop supports --auto-correct.
Style/HashTransformValues:
Exclude:
- 'app/validators/addressable_url_validator.rb'
- 'config/initializers/action_dispatch_journey_formatter.rb'
- 'ee/app/helpers/compliance_management/compliance_framework/project_settings_helper.rb'
- 'ee/app/services/packages/nuget/metadata_extraction_service.rb'
- 'lib/gitlab/config/entry/configurable.rb'
- 'lib/gitlab/config/entry/node.rb'
- 'lib/gitlab/discussions_diff/file_collection.rb'
- 'lib/gitlab/error_tracking.rb'
- 'lib/rspec_flaky/flaky_examples_collection.rb'
- 'spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb'
# Offense count: 31
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse:
Enabled: false
# Offense count: 1474
# Offense count: 1313
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Enabled: false
# Offense count: 314
# Offense count: 377
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal
......@@ -460,51 +609,49 @@ Style/MethodMissingSuper:
Style/MissingRespondToMissing:
Enabled: false
# Offense count: 6
# Offense count: 5
Style/MixinUsage:
Exclude:
- 'spec/factories/ci/builds.rb'
- 'spec/factories/ci/job_artifacts.rb'
- 'spec/factories/lfs_objects.rb'
- 'spec/factories/notes.rb'
- 'spec/lib/gitlab/import_export/project_tree_restorer_spec.rb'
- 'spec/lib/gitlab/import_export/version_checker_spec.rb'
# Offense count: 4
# Offense count: 2
# Cop supports --auto-correct.
Style/MultilineIfModifier:
Exclude:
- 'app/helpers/snippets_helper.rb'
- 'app/services/ci/process_pipeline_service.rb'
- 'lib/api/commit_statuses.rb'
# Offense count: 25
# Offense count: 29
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinBodyLength.
# SupportedStyles: skip_modifier_ifs, always
Style/Next:
Enabled: false
# Offense count: 71
# Offense count: 89
# Cop supports --auto-correct.
# Configuration parameters: EnforcedOctalStyle.
# SupportedOctalStyles: zero_with_o, zero_only
Style/NumericLiteralPrefix:
Enabled: false
# Offense count: 234
# Offense count: 255
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Enabled: false
# Offense count: 106
# Offense count: 117
# Cop supports --auto-correct.
Style/ParallelAssignment:
Enabled: false
# Offense count: 1692
# Offense count: 2035
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
......@@ -526,51 +673,60 @@ Style/PerlBackrefs:
- 'lib/gitlab/search_results.rb'
- 'lib/gitlab/sherlock/query.rb'
# Offense count: 165
# Offense count: 200
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
Enabled: false
# Offense count: 221
# Offense count: 246
# Cop supports --auto-correct.
Style/RedundantFreeze:
Enabled: false
# Offense count: 15
# Offense count: 123
# Cop supports --auto-correct.
Style/RedundantInterpolation:
Enabled: false
# Offense count: 6
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'ee/app/models/ee/merge_request.rb'
# Offense count: 33
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/controllers/concerns/issuable_actions.rb'
- 'app/controllers/groups/application_controller.rb'
- 'app/controllers/omniauth_callbacks_controller.rb'
- 'app/controllers/profiles/keys_controller.rb'
- 'app/controllers/projects/application_controller.rb'
- 'app/services/access_token_validation_service.rb'
- 'lib/gitlab/utils.rb'
- 'lib/google_api/auth.rb'
Enabled: false
# Offense count: 739
# Offense count: 801
# Cop supports --auto-correct.
Style/RedundantSelf:
Enabled: false
# Offense count: 80
# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantSort:
Exclude:
- 'ee/app/presenters/packages/nuget/search_results_presenter.rb'
- 'ee/spec/presenters/packages/nuget/search_results_presenter_spec.rb'
# Offense count: 120
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Enabled: false
# Offense count: 42
# Offense count: 46
# Cop supports --auto-correct.
Style/RescueModifier:
Enabled: false
# Offense count: 237
# Offense count: 286
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
......@@ -592,28 +748,23 @@ Style/SingleLineMethods:
Exclude:
- 'lib/gitlab/ci/ansi2html.rb'
# Offense count: 94
# Offense count: 102
# Cop supports --auto-correct.
# Configuration parameters: .
# SupportedStyles: use_perl_names, use_english_names
Style/SpecialGlobalVars:
EnforcedStyle: use_perl_names
# Offense count: 75
# Offense count: 93
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Enabled: false
# Offense count: 216
# Offense count: 233
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: respond_to, define_method
Style/SymbolProc:
Enabled: false
# Offense count: 99
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Enabled: false
......@@ -361,10 +361,10 @@ group :development, :test do
gem 'spring', '~> 2.0.0'
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
gem 'rubocop', '~> 0.74.0'
gem 'rubocop-performance', '~> 1.4.1'
gem 'rubocop', '~> 0.82.0'
gem 'rubocop-performance', '~> 1.5.2'
gem 'rubocop-rspec', '~> 1.37.0'
gem 'scss_lint', '~> 0.56.0', require: false
......
......@@ -400,11 +400,11 @@ GEM
gitlab-puma (>= 2.7, < 5)
gitlab-sidekiq-fetcher (0.5.2)
sidekiq (~> 5)
gitlab-styles (3.2.0)
rubocop (~> 0.74.0)
gitlab-styles (4.2.0)
rubocop (~> 0.82.0)
rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.4.1)
rubocop-rails (~> 2.0)
rubocop-performance (~> 1.5.2)
rubocop-rails (~> 2.5)
rubocop-rspec (~> 1.36)
gitlab_chronic_duration (0.10.6.2)
numerizer (~> 0.2)
......@@ -748,7 +748,7 @@ GEM
orm_adapter (0.5.0)
os (1.0.0)
parallel (1.19.1)
parser (2.7.0.4)
parser (2.7.1.2)
ast (~> 2.4.0)
parslet (1.8.2)
peek (1.1.0)
......@@ -886,6 +886,7 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.2)
rexml (3.2.4)
rinku (2.0.0)
rotp (2.1.2)
rouge (3.19.0)
......@@ -929,18 +930,20 @@ GEM
pg
rails
sqlite3
rubocop (0.74.0)
rubocop (0.82.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
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 (>= 0.51)
rubocop-performance (1.4.1)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.0)
rubocop-rails (2.5.2)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.0)
......@@ -1081,7 +1084,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.6.0)
unicode-display_width (1.7.0)
unicode_plot (0.0.4)
enumerable-statistics (>= 2.0.1)
unicode_utils (1.4.0)
......@@ -1243,7 +1246,7 @@ DEPENDENCIES
gitlab-puma (~> 4.3.3.gitlab.2)
gitlab-puma_worker_killer (~> 0.1.1.gitlab.1)
gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 3.2.0)
gitlab-styles (~> 4.2.0)
gitlab_chronic_duration (~> 0.10.6.2)
gitlab_omniauth-ldap (~> 2.1.1)
gon (~> 6.2)
......@@ -1355,8 +1358,8 @@ DEPENDENCIES
rspec-retry (~> 0.6.1)
rspec_junit_formatter
rspec_profiling (~> 0.0.5)
rubocop (~> 0.74.0)
rubocop-performance (~> 1.4.1)
rubocop (~> 0.82.0)
rubocop-performance (~> 1.5.2)
rubocop-rspec (~> 1.37.0)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 1.3.0)
......
......@@ -757,13 +757,13 @@ module Ci
# and use that for `ExpireBuildInstanceArtifactsWorker`?
def erase_erasable_artifacts!
job_artifacts.erasable.destroy_all # rubocop: disable DestroyAll
job_artifacts.erasable.destroy_all # rubocop: disable Cop/DestroyAll
end
def erase(opts = {})
return false unless erasable?
job_artifacts.destroy_all # rubocop: disable DestroyAll
job_artifacts.destroy_all # rubocop: disable Cop/DestroyAll
erase_trace!
update_erased!(opts[:erased_by])
end
......
......@@ -44,13 +44,13 @@ class LfsObject < ApplicationRecord
file_store == LfsObjectUploader::Store::LOCAL
end
# rubocop: disable DestroyAll
# rubocop: disable Cop/DestroyAll
def self.destroy_unreferenced
joins("LEFT JOIN lfs_objects_projects ON lfs_objects_projects.lfs_object_id = #{table_name}.id")
.where(lfs_objects_projects: { id: nil })
.destroy_all
end
# rubocop: enable DestroyAll
# rubocop: enable Cop/DestroyAll
def self.calculate_oid(path)
self.hexdigest(path)
......
......@@ -718,7 +718,7 @@ class User < ApplicationRecord
otp_grace_period_started_at: nil,
otp_backup_codes: nil
)
self.u2f_registrations.destroy_all # rubocop: disable DestroyAll
self.u2f_registrations.destroy_all # rubocop: disable Cop/DestroyAll
end
end
......
......@@ -13,7 +13,7 @@ module AwardEmojis
return error("User has not awarded emoji of type #{name} on the awardable", status: :forbidden)
end
award = awards.destroy_all.first # rubocop: disable DestroyAll
award = awards.destroy_all.first # rubocop: disable Cop/DestroyAll
after_destroy(award)
success(award: award)
......
......@@ -90,7 +90,7 @@ module Labels
# rubocop: disable CodeReuse/ActiveRecord
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
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -76,7 +76,7 @@ module Milestones
# rubocop: disable CodeReuse/ActiveRecord
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
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -4,7 +4,7 @@ module Pages
class DeleteService < BaseService
def execute
project.remove_pages
project.pages_domains.destroy_all # rubocop: disable DestroyAll
project.pages_domains.destroy_all # rubocop: disable Cop/DestroyAll
end
end
end
......@@ -28,7 +28,7 @@ module Projects
# rubocop: enable CodeReuse/ActiveRecord
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
......@@ -20,7 +20,7 @@ module Projects
end
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
# rubocop: disable CodeReuse/ActiveRecord
......
......@@ -21,7 +21,7 @@ module Projects
# Remove remaining notification settings from source_project
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
# Get users of current notification_settings
......
......@@ -25,7 +25,7 @@ module Projects
# Remove remaining project group links from source_project
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
def group_links_in_target_project
......
......@@ -25,7 +25,7 @@ module Projects
def remove_remaining_members
# 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
def project_members_in_target_project
......
......@@ -39,11 +39,11 @@ module ProtectedBranches
def delete_redundant_access_levels
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
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
......
......@@ -19,7 +19,7 @@ module Snippets
user_can_delete_snippets!
attempt_delete_repositories!
snippets.destroy_all # rubocop: disable DestroyAll
snippets.destroy_all # rubocop: disable Cop/DestroyAll
ServiceResponse.success(message: 'Snippets were deleted.')
rescue SnippetAccessError
......
......@@ -86,7 +86,7 @@
%li
%span.light Current sign-in IP:
%strong
- if @user.current_sign_in_ip
- if @user.current_sign_in_ip # rubocop:disable Style/RedundantCondition
= @user.current_sign_in_ip
- else
never
......@@ -102,7 +102,7 @@
%li
%span.light Last sign-in IP:
%strong
- if @user.last_sign_in_ip
- if @user.last_sign_in_ip # rubocop:disable Style/RedundantCondition
= @user.last_sign_in_ip
- else
never
......
......@@ -21,7 +21,7 @@
- elsif type == 'checkbox'
= form.check_box name
- 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'
= 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
......
......@@ -7,7 +7,7 @@ class RemoveExpiredGroupLinksWorker # rubocop:disable Scalability/IdempotentWork
feature_category :authentication_and_authorization
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|
Groups::GroupLinks::DestroyService.new(nil, nil).execute(link_batch)
......
require_relative '../migrate/20180223120443_create_user_interacted_projects_table.rb'
# rubocop:disable AddIndex
# rubocop:disable AddConcurrentForeignKey
# rubocop:disable Migration/AddIndex
# rubocop:disable Migration/AddConcurrentForeignKey
class BuildUserInteractedProjectsTable < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
......
......@@ -29,7 +29,7 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
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' })
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -12,8 +12,8 @@ module EE
return unless group.present? && project.present?
# For protected branches
project.protected_branches.merge_access_by_group(group).destroy_all # rubocop: disable DestroyAll
project.protected_branches.push_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 Cop/DestroyAll
# For protected tags
project.protected_tags.create_access_by_group(group).delete_all
......
......@@ -19,8 +19,8 @@ module EE
def delete_member_branch_protection
if user.present? && project.present?
project.protected_branches.merge_access_by_user(user).destroy_all # rubocop: disable DestroyAll
project.protected_branches.push_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 Cop/DestroyAll
end
end
......
......@@ -10,8 +10,8 @@ module CleanupApprovers
# rubocop: disable CodeReuse/ActiveRecord
def cleanup_approvers(target, reload: false)
target.approvers.where.not(user_id: params[:approver_ids]).destroy_all # rubocop: disable DestroyAll
target.approver_groups.where.not(group_id: params[:approver_group_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 Cop/DestroyAll
# 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
......
......@@ -14,18 +14,18 @@ module EE
def delete_redundant_access_levels
case developers_can_merge
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
protected_branch.merge_access_levels.developer.destroy_all # rubocop: disable DestroyAll
protected_branch.merge_access_levels.maintainer.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 Cop/DestroyAll
end
case developers_can_push
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
protected_branch.push_access_levels.developer.destroy_all # rubocop: disable DestroyAll
protected_branch.push_access_levels.maintainer.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 Cop/DestroyAll
end
end
end
......
......@@ -11,7 +11,7 @@ module MergeRequests
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!
create_note(merge_request)
......
......@@ -50,7 +50,7 @@ describe Projects::Settings::IntegrationsController do
context 'without a license key' do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
end
it_behaves_like 'endpoint with some disabled services'
......
......@@ -12,7 +12,7 @@ describe "Admin uploads license" do
context "when license key is provided in the query string" do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
visit(admin_license_path(trial_key: license.data))
......@@ -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
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
visit(admin_license_path(trial_key: ""))
end
......
......@@ -171,7 +171,7 @@ describe Gitlab::Database::LoadBalancing do
context 'without a license' do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
end
it 'is disabled' do
......
......@@ -112,7 +112,7 @@ describe Burndown do
context "when all closed issues do not have closed events" 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
it "considers closed_at as milestone start date" do
......@@ -137,7 +137,7 @@ describe Burndown do
context "when one but not all closed issues does not have a closed event" 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)
aggregate_failures do
......
......@@ -175,7 +175,7 @@ describe JenkinsService do
context 'without a license key' do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
end
it_behaves_like 'project with disabled Jenkins service'
......
......@@ -703,7 +703,7 @@ describe GroupPolicy do
nested_group.add_guest(developer)
nested_group.add_guest(maintainer)
group.owners.destroy_all # rubocop: disable DestroyAll
group.owners.destroy_all # rubocop: disable Cop/DestroyAll
group.add_guest(owner)
nested_group.add_owner(owner)
......
......@@ -134,7 +134,7 @@ describe MergeRequests::UpdateService, :mailer do
update_merge_request(approver_ids: [existing_approver, removed_approver].map(&:id).join(','))
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
end
......
......@@ -17,7 +17,7 @@ RSpec.configure do |config|
end
config.before(:all) do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
TestLicense.init
end
......
......@@ -32,7 +32,7 @@ describe HistoricalDataWorker do
context 'when there is not a license key' 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!)
......
......@@ -21,7 +21,7 @@ describe LdapAllGroupsSyncWorker do
context 'without a license key' do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
end
it 'does not sync all groups' do
......
......@@ -37,7 +37,7 @@ describe LdapGroupSyncWorker do
context 'without a license key' do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
end
it 'does not sync groups' do
......
......@@ -23,7 +23,7 @@ describe LdapSyncWorker do
context 'without a license key' do
before do
License.destroy_all # rubocop: disable DestroyAll
License.destroy_all # rubocop: disable Cop/DestroyAll
end
it 'does not sync LDAP users' do
......
......@@ -15,7 +15,7 @@ Metrics/AbcSize:
Metrics/PerceivedComplexity:
Enabled: true
Metrics/LineLength:
Layout/LineLength:
Enabled: true
Details: >
Long lines are very hard to read and make it more difficult to review
......
......@@ -49,7 +49,7 @@ module Gitlab
def ensure_default_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)
rescue => e
......
......@@ -212,7 +212,7 @@ describe OmniauthCallbacksController, type: :controller do
end
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)
expect { post provider }.to change { user.reload.identities.count }.by(1)
......
......@@ -16,7 +16,7 @@ describe Projects::Tags::ReleasesController do
describe 'GET #edit' do
it 'initializes a new release' do
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 }
......
......@@ -15,7 +15,7 @@ describe Gitlab::Import::MergeRequestCreator do
it 'updates the data' do
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)
......
......@@ -33,7 +33,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do
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.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(external_data_counter).to be > 0
......
......@@ -13,7 +13,7 @@ describe ForkNetworkMember do
let(:fork_network) { fork_network_member.fork_network }
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)
end
......
......@@ -75,7 +75,7 @@ describe SystemHook do
it "project member destroy hook" do
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(
body: /user_remove_from_team/,
......@@ -121,7 +121,7 @@ describe SystemHook do
it 'group member destroy hook' do
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(
body: /user_remove_from_group/,
......
......@@ -2623,7 +2623,7 @@ describe MergeRequest do
context 'with no discussions' do
before do
merge_request.notes.destroy_all # rubocop: disable DestroyAll
merge_request.notes.destroy_all # rubocop: disable Cop/DestroyAll
end
it 'returns true' do
......
......@@ -60,7 +60,7 @@ describe ProjectGroupLink do
project.project_group_links.create(group: group)
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) }
end
end
......
......@@ -175,7 +175,7 @@ describe GroupPolicy do
nested_group.add_guest(developer)
nested_group.add_guest(maintainer)
group.owners.destroy_all # rubocop: disable DestroyAll
group.owners.destroy_all # rubocop: disable Cop/DestroyAll
group.add_guest(owner)
nested_group.add_owner(owner)
......
......@@ -11,7 +11,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
context 'when using ActiveRecord::Base' do
it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
users = User.all
users.reload
^^^^^^ 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
end
it 'does not register an offense on reset usage' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
users = User.all
users.reset
PATTERN
......@@ -28,7 +28,7 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
context 'when using ActiveRecord::Relation' do
it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
user = User.new
user.reload
^^^^^^ 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
end
it 'does not register an offense on reset usage' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
user = User.new
user.reset
PATTERN
......@@ -45,14 +45,14 @@ describe RuboCop::Cop::ActiveRecordAssociationReload do
context 'when using on self' do
it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
reload
^^^^^^ Use reset instead of reload. For more details check the https://gitlab.com/gitlab-org/gitlab-foss/issues/60218.
PATTERN
end
it 'does not register an offense on reset usage' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
reset
PATTERN
end
......
......@@ -14,14 +14,14 @@ describe RuboCop::Cop::AvoidRouteRedirectLeadingSlash do
end
it 'registers an offense when redirect has a leading slash' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
root to: redirect("/-/route")
^^^^^^^^^^^^^^^^^^^^ Do not use a leading "/" in route redirects
PATTERN
end
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")
PATTERN
end
......
......@@ -11,13 +11,13 @@ describe RuboCop::Cop::DestroyAll do
subject(:cop) { described_class.new }
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)
end
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)
end
......@@ -31,7 +31,7 @@ describe RuboCop::Cop::DestroyAll do
it 'flags the use of destroy_all with a local variable receiver' do
inspect_source(<<~RUBY)
users = User.all
users.destroy_all # rubocop: disable DestroyAll
users.destroy_all # rubocop: disable Cop/DestroyAll
RUBY
expect(cop.offenses.size).to eq(1)
......
......@@ -12,7 +12,7 @@ describe RuboCop::Cop::Gitlab::ChangeTimezone do
context 'Time.zone=' do
it 'registers an offense with no 2nd argument' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
Time.zone = 'Awkland'
^^^^^^^^^^^^^^^^^^^^^ Do not change timezone in the runtime (application or rspec), it could result in silently modifying other behavior.
PATTERN
......
......@@ -12,7 +12,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'Object.const_get' do
it 'registers an offense with no 2nd argument' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
Object.const_get(:CONSTANT)
^^^^^^^^^ Use inherit=false when using const_get.
PATTERN
......@@ -24,7 +24,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=false' do
it 'does not register an offense' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
Object.const_get(:CONSTANT, false)
PATTERN
end
......@@ -32,7 +32,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=true' do
it 'registers an offense' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
Object.const_get(:CONSTANT, true)
^^^^^^^^^ Use inherit=false when using const_get.
PATTERN
......@@ -46,7 +46,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'const_get for a nested class' do
it 'registers an offense on reload usage' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
Nested::Blog.const_get(:CONSTANT)
^^^^^^^^^ Use inherit=false when using const_get.
PATTERN
......@@ -58,7 +58,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=false' do
it 'does not register an offense' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
Nested::Blog.const_get(:CONSTANT, false)
PATTERN
end
......@@ -66,7 +66,7 @@ describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do
context 'inherit=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)
^^^^^^^^^ Use inherit=false when using const_get.
PATTERN
......
......@@ -20,7 +20,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
context 'Non-EE spec file' 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
end
SOURCE
......@@ -29,7 +29,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
context 'Non-EE application file' 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
end
SOURCE
......@@ -38,7 +38,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
context 'EE application file' 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
end
SOURCE
......@@ -49,7 +49,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
let(:spec_file_path) { full_path('ee/spec/controllers/foo_spec.rb') }
it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, spec_file_path)
expect_no_offenses(<<~SOURCE, spec_file_path)
describe 'Foo' do
end
SOURCE
......@@ -65,7 +65,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
end
it 'marks the describe as offending' do
expect_offense(<<~SOURCE.strip_indent, spec_file_path)
expect_offense(<<~SOURCE, spec_file_path)
describe 'Foo' do
^^^^^^^^^^^^^^ Duplicate spec location in `ee/spec/controllers/ee/foo_spec.rb`.
end
......@@ -78,7 +78,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
let(:spec_file_path) { full_path('ee/spec/controllers/ee/foo_spec.rb') }
it 'registers no offenses' do
expect_no_offenses(<<~SOURCE.strip_indent, spec_file_path)
expect_no_offenses(<<~SOURCE, spec_file_path)
describe 'Foo' do
end
SOURCE
......@@ -94,7 +94,7 @@ describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do
end
it 'marks the describe as offending' do
expect_offense(<<~SOURCE.strip_indent, spec_file_path)
expect_offense(<<~SOURCE, spec_file_path)
describe 'Foo' do
^^^^^^^^^^^^^^ Duplicate spec location in `ee/spec/controllers/foo_spec.rb`.
end
......
......@@ -18,7 +18,7 @@ describe RuboCop::Cop::Migration::AddIndex do
end
it 'registers an offense when add_index is used' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
def change
add_index :table, :column
^^^^^^^^^ `add_index` requires downtime, use `add_concurrent_index` instead
......@@ -29,7 +29,7 @@ describe RuboCop::Cop::Migration::AddIndex do
context 'outside of migration' do
it 'registers no offense' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
def change
add_index :table, :column
end
......
......@@ -14,7 +14,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do
end
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
resource :issues
end
......@@ -25,7 +25,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do
end
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
resource :issues
resource :notes
......@@ -34,7 +34,7 @@ describe RuboCop::Cop::PutGroupRoutesUnderScope do
end
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
resource :issues
resource :projects do
......
......@@ -14,7 +14,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do
end
it 'registers an offense when route is outside scope' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
scope '-' do
resource :issues
end
......@@ -25,7 +25,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do
end
it 'does not register an offense when resource inside the scope' do
expect_no_offenses(<<~PATTERN.strip_indent)
expect_no_offenses(<<~PATTERN)
scope '-' do
resource :issues
resource :notes
......@@ -34,7 +34,7 @@ describe RuboCop::Cop::PutProjectRoutesUnderScope do
end
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
resource :issues
resource :projects do
......
......@@ -15,7 +15,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the file ends in _spec.rb' 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
end
SOURCE
......@@ -24,7 +24,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the file is a frontend fixture' 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
end
SOURCE
......@@ -34,7 +34,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the describe is in a shared example' do
context 'with shared_examples' 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
describe '#bar' do
end
......@@ -45,7 +45,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'with shared_examples_for' 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
describe '#bar' do
end
......@@ -57,7 +57,7 @@ describe RuboCop::Cop::RSpec::TopLevelDescribePath do
context 'when the describe is at the top level' 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
^^^^^^^^^^^^^^ #{described_class::MESSAGE}
end
......
......@@ -12,7 +12,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
subject(:cop) { described_class.new }
it "adds an offense when calling bulk_perform_async" do
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
Worker.bulk_perform_async(args)
CODE
......@@ -20,7 +20,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
end
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|
ids = relation.pluck_primary_key.map { |id| [id] }
DeleteDiffFilesWorker.bulk_perform_in(index * 5.minutes, ids)
......@@ -33,7 +33,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
it "does not add an offense for migrations" do
allow(cop).to receive(:in_migration?).and_return(true)
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
Worker.bulk_perform_in(args)
CODE
......@@ -43,7 +43,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
it "does not add an offence for specs" do
allow(cop).to receive(:in_spec?).and_return(true)
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
Worker.bulk_perform_in(args)
CODE
......@@ -51,7 +51,7 @@ describe RuboCop::Cop::Scalability::BulkPerformWithContext do
end
it "does not add an offense for scheduling BackgroundMigrations" do
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
BackgroundMigrationWorker.bulk_perform_in(args)
CODE
......
......@@ -12,7 +12,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
subject(:cop) { described_class.new }
it 'adds an offense when including CronjobQueue' do
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
class SomeWorker
include CronjobQueue
end
......@@ -22,14 +22,14 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
it 'does not add offenses for other workers' do
expect_no_offenses(<<~CODE.strip_indent)
expect_no_offenses(<<~CODE)
class SomeWorker
end
CODE
end
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
include CronjobQueue
......@@ -39,7 +39,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
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
include CronjobQueue
......@@ -53,7 +53,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
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
include CronjobQueue
......@@ -67,7 +67,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
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
include CronjobQueue
......
......@@ -15,7 +15,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
context 'with required params' do
it 'detects File in types array' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
params do
requires :certificate, allow_blank: false, types: [String, File]
^^^^ #{message}
......@@ -24,7 +24,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
end
it 'detects File as type argument' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
params do
requires :attachment, type: File
^^^^ #{message}
......@@ -35,7 +35,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
context 'with optional params' do
it 'detects File in types array' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
params do
optional :certificate, allow_blank: false, types: [String, File]
^^^^ #{message}
......@@ -44,7 +44,7 @@ describe RuboCop::Cop::Scalability::FileUploads do
end
it 'detects File as type argument' do
expect_offense(<<~PATTERN.strip_indent)
expect_offense(<<~PATTERN)
params do
optional :attachment, type: File
^^^^ #{message}
......
......@@ -18,7 +18,7 @@ describe RuboCop::Cop::Scalability::IdempotentWorker do
end
it 'adds an offense when not defining idempotent method' do
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
class SomeWorker
end
CODE
......@@ -27,7 +27,7 @@ describe RuboCop::Cop::Scalability::IdempotentWorker do
end
it 'adds an offense when not defining idempotent method' do
inspect_source(<<~CODE.strip_indent)
inspect_source(<<~CODE)
class SomeWorker
idempotent!
end
......
......@@ -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) }
before do
# rubocop: disable DestroyAll
# rubocop: disable Cop/DestroyAll
project.merge_requests
.where(source_branch: opts[:source_branch], target_branch: opts[:target_branch])
.destroy_all
# rubocop: enable DestroyAll
# rubocop: enable Cop/DestroyAll
end
it 'sets head pipeline' do
......
......@@ -48,12 +48,12 @@ describe MergeRequests::DeleteNonLatestDiffsService, :clean_gitlab_redis_shared_
end
it 'schedules no removal if there is no non-latest diffs' do
# rubocop: disable DestroyAll
# rubocop: disable Cop/DestroyAll
merge_request
.merge_request_diffs
.where.not(id: merge_request.latest_merge_request_diff_id)
.destroy_all
# rubocop: enable DestroyAll
# rubocop: enable Cop/DestroyAll
expect(DeleteDiffFilesWorker).not_to receive(:bulk_perform_in)
......
......@@ -8,7 +8,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
it 'skips when the project has no push events' do
project = create(:project, :repository, :wiki_disabled)
project.events.destroy_all # rubocop: disable DestroyAll
project.events.destroy_all # rubocop: disable Cop/DestroyAll
break_project(project)
expect(worker).not_to receive(:git_fsck)
......
......@@ -4,6 +4,6 @@
source 'https://rubygems.org'
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 'haml_lint', '~> 0.34.0', require: false
GEM
remote: https://rubygems.org/
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)
childprocess (3.0.0)
ffi (1.12.1)
gitlab-styles (3.1.0)
rubocop (~> 0.74.0)
concurrent-ruby (1.1.6)
ffi (1.12.2)
gitlab-styles (4.2.0)
rubocop (~> 0.82.0)
rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.4.1)
rubocop-rails (~> 2.0)
rubocop-performance (~> 1.5.2)
rubocop-rails (~> 2.5)
rubocop-rspec (~> 1.36)
haml (5.1.2)
temple (>= 0.8.0)
tilt
haml_lint (0.34.1)
haml_lint (0.34.0)
haml (>= 4.0, < 5.2)
rainbow
rubocop (>= 0.50.0)
sysexits (~> 1.1)
iniparse (1.4.4)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
iniparse (1.5.0)
jaro_winkler (1.5.4)
overcommit (0.52.1)
minitest (5.11.3)
overcommit (0.53.0)
childprocess (>= 0.6.3, < 4)
iniparse (~> 1.4)
parallel (1.19.1)
parser (2.7.0.2)
parser (2.7.1.2)
ast (~> 2.4.0)
rack (2.1.1)
rack (2.0.9)
rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
rubocop (0.74.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rexml (3.2.4)
rubocop (0.82.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
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 (>= 0.51)
rubocop-performance (1.4.1)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.1)
rubocop-rails (2.5.2)
activesupport
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.1)
rubocop-rspec (1.37.0)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
sass (3.5.7)
sass (3.5.5)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
......@@ -59,14 +72,18 @@ GEM
sass (~> 3.5.3)
sysexits (1.2.0)
temple (0.8.2)
thread_safe (0.3.6)
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
ruby
DEPENDENCIES
gitlab-styles (~> 3.1.0)
gitlab-styles (~> 4.2.0)
haml_lint (~> 0.34.0)
overcommit
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