Skip to content

Upgrade RuboCop (to 1.66.0) and rubocop extensions

Martin Schurz requested to merge schurzi/gitlab-styles:rubocop1.65.1 into master
  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

Config diff for monolith

had to change .robucop.yml

diff --git a/.rubocop.yml b/.rubocop.yml
index f2dbc1e5db14..6ff669028597 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -3,8 +3,11 @@ inherit_gem:
     - rubocop-default.yml

 require:
-  - ./rubocop/rubocop
+  - rubocop-factory_bot
   - rubocop-rspec
+  - ./rubocop/rubocop
Config diff for monolith
--- before.txt	2024-08-30 20:58:12.598791203 +0200
+++ after3.txt	2024-08-31 19:53:54.526923253 +0200
@@ -1,4 +1,4 @@
-# Available cops (1113) + config for /home/mch/gitlab-development-kit/gitlab: 
+# Available cops (1123) + config for /home/mch/gitlab-development-kit/gitlab: 
 # Department 'API' (3):
 # Supports --autocorrect
 API/Base:
@@ -325,7 +325,7 @@
 CodeReuse/Worker:
   Enabled: true
 
-# Department 'Cop' (39):
+# Department 'Cop' (38):
 Cop/ActiveModelErrorsDirectManipulation:
   Enabled: true
 
@@ -558,9 +558,6 @@
   - "/home/mch/gitlab-development-kit/gitlab/ee/spec/**/*.rb"
   Enabled: true
 
-Cop/WithoutReactiveCache:
-  Enabled: true
-
 # Department 'Database' (7):
 Database/AvoidInheritanceColumn:
   Exclude:
@@ -807,6 +804,7 @@
 FactoryBot/CreateList:
   Description: Checks for create_list usage.
   Enabled: true
+  AutoCorrect: contextual
   Include:
   - "**/*_spec.rb"
   - "**/spec/**/*"
@@ -819,7 +817,7 @@
   ExplicitOnly: false
   SafeAutoCorrect: false
   VersionAdded: '1.25'
-  VersionChanged: '2.24'
+  VersionChanged: '2.26'
   Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/CreateList
 
 FactoryBot/ExcessiveCreateList:
@@ -1025,7 +1023,17 @@
   Include:
   - Gemfile
 
-# Department 'Gemspec' (9):
+# Department 'Gemspec' (10):
+# Supports --autocorrect
+Gemspec/AddRuntimeDependency:
+  Description: Prefer `add_dependency` over `add_runtime_dependency`.
+  StyleGuide: "#add_dependency_vs_add_runtime_dependency"
+  Reference: https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316
+  Enabled: true
+  VersionAdded: '1.65'
+  Include:
+  - "**/*.gemspec"
+
 Gemspec/AvoidExecutingGit:
   Enabled: false

@@ -8696,9 +8696,6 @@
   VersionAdded: 0.12.0
   Description: Arguments should either be listed explicitly or **rest should be in the
     resolve signature
-  Exclude:
-  - "/home/mch/gitlab-development-kit/gitlab/app/graphql/mutations/jira_import/start.rb"
-  - "/home/mch/gitlab-development-kit/gitlab/app/graphql/resolvers/packages_base_resolver.rb"
 
 # Department 'Graphql' (10):
 Graphql/AuthorizeTypes:
@@ -17457,7 +17436,7 @@
   VersionChanged: '1.0'
   AllowInHeredoc: false
 
-# Department 'Lint' (137):
+# Department 'Lint' (138):
 Lint/AmbiguousAssignment:
   Description: Checks for mistyped shorthand assignments.
   Enabled: true
@@ -17840,7 +17819,7 @@
   Description: Check for debugger calls.
   Enabled: true
   VersionAdded: '0.14'
-  VersionChanged: '1.46'
+  VersionChanged: '1.63'
   DebuggerMethods:
     Kernel:
     - binding.irb
@@ -17851,8 +17830,14 @@
     - Kernel.byebug
     - Kernel.remote_byebug
     Capybara:
+    - page.save_and_open_page
+    - page.save_and_open_screenshot
+    - page.save_page
+    - page.save_screenshot
     - save_and_open_page
     - save_and_open_screenshot
+    - save_page
+    - save_screenshot
     debug.rb:
     - binding.b
     - binding.break
@@ -17875,6 +17860,10 @@
     WebConsole:
     - binding.console
     PryShell: binding.pry_shell
+  DebuggerRequires:
+    debug.rb:
+    - debug/open
+    - debug/start
 
 # Supports --autocorrect
 Lint/DeprecatedClassMethods:
@@ -18334,6 +18323,7 @@
   StyleGuide: "#identity-comparison"
   VersionAdded: '0.91'
 
+# Supports --autocorrect
 Lint/ImplicitStringConcatenation:
   Description: Checks for adjacent string literals on the same line, which could better
     be represented as a single string literal.
@@ -20675,8 +20664,7 @@
   Enabled: true
   AutoCorrect: contextual
   VersionAdded: '0.11'
-  VersionChanged: '1.61'
-  SafeAutoCorrect: false
+  VersionChanged: '1.66'
 
 Lint/UselessElseWithoutRescue:
   Description: Checks for useless `else` in `begin..end` without `rescue`.
@@ -20693,6 +20681,12 @@
   VersionChanged: '1.61'
   Safe: false
 
+# Supports --autocorrect
+Lint/UselessNumericOperation:
+  Description: Checks for useless numeric operations.
+  Enabled: true
+  VersionAdded: '1.66'
+
 Lint/UselessRescue:
   Description: Checks for useless `rescue`s.
   Enabled: pending
@@ -20774,8 +20768,9 @@
   StyleGuide: "#three-is-the-number-thou-shalt-count"
   Enabled: true
   VersionAdded: '0.25'
-  VersionChanged: '0.47'
+  VersionChanged: '1.65'
   CountBlocks: false
+  CountModifierForms: false
   Max: 4
 
 Metrics/ClassLength:
@@ -21294,6 +21289,7 @@
   VersionAdded: '0.50'
   VersionChanged: '1.23'
   Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/Rakefile.rb"
   - "/home/mch/gitlab-development-kit/gitlab/**/*/*.builder"
   - "/home/mch/gitlab-development-kit/gitlab/ee/bin/*"
   - "/home/mch/gitlab-development-kit/gitlab/config.ru"
@@ -21667,7 +21663,8 @@
   - is_
   - has_
   - have_
-  ForbiddenPrefixes: is_
+  ForbiddenPrefixes:
+  - is_
   AllowedMethods:
   - is_a?
   MethodDefinitionMacros:
@@ -21839,6 +21836,7 @@
   Enabled: true
   Safe: false
   VersionAdded: '0.36'
+  VersionChanged: '1.21'
 
 Performance/ChainArrayAllocation:
   Description: Instead of chaining array methods that allocate new arrays, mutate an
@@ -22672,7 +22669,7 @@
   Exclude:
   - "/home/mch/gitlab-development-kit/gitlab/spec/rubocop/**/*_spec.rb"
 
-# Department 'RSpec' (135):
+# Department 'RSpec' (138):
 # Supports --autocorrect
 RSpec/AlignLeftLetBrace:
   Description: Checks that left braces for adjacent single line lets are aligned.
@@ -23141,18 +23138,1648 @@
 # Supports --autocorrect
 RSpec/BeEmpty:
   Description: Prefer using `be_empty` when checking for an empty array.
-  Enabled: pending
+  Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '2.20'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEmpty
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/subscriptions/groups_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/tooling/lib/tooling/mappings/view_to_js_mappings_spec.rb"
 
 # Supports --autocorrect
 RSpec/BeEq:
   Description: Check for expectations where `be(...)` can replace `eq(...)`.
-  Enabled: pending
+  Enabled: true
   Safe: false
   VersionAdded: 2.9.0
   VersionChanged: '2.16'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEq
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/bin/custom_ability_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/users/unconfirmed_secondary_emails_deletion_cron_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/BeEql:
@@ -23166,7 +24793,7 @@
 # Supports --autocorrect
 RSpec/BeNil:
   Description: Ensures a consistent style is used when matching `nil`.
-  Enabled: pending
+  Enabled: true
   EnforcedStyle: be_nil
   SupportedStyles:
   - be
@@ -23174,6 +24801,186 @@
   VersionAdded: 2.9.0
   VersionChanged: 2.10.0
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeNil
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/projects_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/error_tracking_issue_link_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/BeSuccessMatcher:
@@ -24558,11 +26364,134 @@
 # Supports --autocorrect
 RSpec/ChangeByZero:
   Description: Prefer negated matchers over `to change.by(0)`.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.11'
   VersionChanged: '2.14'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ChangeByZero
   NegatedMatcher: 
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/groups/todos_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/remove_expired_members_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/ClassCheck:
@@ -24579,9 +26508,207 @@
 # Supports --autocorrect
 RSpec/ContainExactly:
   Description: Checks where `contain_exactly` is used.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.19'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContainExactly
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/operations_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/emails_on_push_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/ContextMethod:
@@ -27627,7 +29754,7 @@
 # Supports --autocorrect
 RSpec/DuplicatedMetadata:
   Description: Avoid duplicated metadata.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.16'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DuplicatedMetadata
 
@@ -27635,16 +29762,19 @@
 RSpec/EmptyExampleGroup:
   Description: Checks if an example group does not include any tests.
   Enabled: true
+  AutoCorrect: contextual
   SafeAutoCorrect: false
   VersionAdded: '1.7'
-  VersionChanged: '2.13'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
 
 # Supports --autocorrect
 RSpec/EmptyHook:
   Description: Checks for empty before and after hooks.
   Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '1.39'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyHook
 
 # Supports --autocorrect
@@ -27701,11 +29831,20 @@
 # Supports --autocorrect
 RSpec/EmptyMetadata:
   Description: Avoid empty metadata hash.
-  Enabled: pending
+  Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '2.24'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyMetadata
 
 # Supports --autocorrect
+RSpec/EmptyOutput:
+  Description: Check that the `output` matcher is not called with an empty string.
+  Enabled: true
+  VersionAdded: '2.29'
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyOutput
+
+# Supports --autocorrect
 RSpec/EnvAssignment:
   Enable: true
   Include:
@@ -27734,7 +29873,7 @@
 # Supports --autocorrect
 RSpec/Eq:
   Description: Use `eq` instead of `be ==` to compare objects.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.24'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Eq
 
@@ -27860,9 +29999,103 @@
 # Supports --autocorrect
 RSpec/ExcessiveDocstringSpacing:
   Description: Checks for excessive whitespace in example descriptions.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.5'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/ee/groups/usage_quotas_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/views/projects/settings/operations/show.html.haml_spec.rb"
 
 # Supports --autocorrect
 RSpec/ExpectActual:
@@ -28703,6 +30935,35 @@
   - "/home/mch/gitlab-development-kit/gitlab/spec/workers/service_desk_email_receiver_worker_spec.rb"
   - "/home/mch/gitlab-development-kit/gitlab/spec/workers/upload_checksum_worker_spec.rb"
 
+RSpec/ExpectInLet:
+  Description: Do not use `expect` in let.
+  Enabled: true
+  VersionAdded: '2.30'
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInLet
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/models/elasticsearch_indexed_namespace_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/tasks/gitlab/audit_event_types/check_docs_task_spec.rb"
+
 RSpec/ExpectOutput:
   Description: Checks for opportunities to use `expect { ... }.to output`.
   Enabled: true
@@ -33108,102 +35367,13 @@
   - "/home/mch/gitlab-development-kit/gitlab/gems/**/*.rb"
   Enabled: true
 
-RSpec/FilePath:
-  Description: Checks that spec file paths are consistent and well-formed.
-  Enabled: true
-  Include:
-  - "**/*_spec*rb*"
-  - "**/spec/**/*"
-  CustomTransform:
-    RuboCop: rubocop
-    RSpec: rspec
-    HTTPartyBasicAuth: httparty_basic_auth
-  IgnoreMethods: true
-  SpecSuffixOnly: false
-  VersionAdded: '1.2'
-  VersionChanged: '2.24'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
-  Exclude:
-  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/frontend/fixtures/analytics/charts.rb"
...
-  - "/home/mch/gitlab-development-kit/gitlab/spec/fixtures/**/*"
-
 # Supports --autocorrect
 RSpec/Focus:
   Description: Checks if examples are focused.
   Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '1.5'
-  VersionChanged: '2.1'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
 
 # Supports --autocorrect
@@ -33240,14 +35410,46 @@
 RSpec/HooksBeforeExamples:
   Description: Checks for before/around/after hooks that come after an example.
   Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '1.29'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
 
 RSpec/IdenticalEqualityAssertion:
   Description: Checks for equality assertions with identical expressions on both sides.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.4'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/lib/gitlab/ci/reports/license_scanning/license_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/merge_requests/ensure_prepared_worker_spec.rb"
 
 RSpec/ImplicitBlockExpectation:
   Description: Check that implicit block expectation syntax is not used.
@@ -33284,13 +35486,1663 @@
 
 RSpec/IndexedLet:
   Description: Do not set up test data using indexes (e.g., `item_1`, `item_2`).
-  Enabled: pending
+  Enabled: false
   VersionAdded: '2.20'
   VersionChanged: '2.23'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IndexedLet
   Max: 1
   AllowedIdentifiers: []
   AllowedPatterns: []
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/admin/application_settings_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/InstanceSpy:
@@ -33442,10 +37294,45 @@
 # Supports --autocorrect
 RSpec/IsExpectedSpecify:
   Description: Check for `specify` with `is_expected` and one-liner expectations.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.27'
   StyleGuide: https://rspec.rubystyle.guide/#it-and-specify
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IsExpectedSpecify
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/policies/project_policy_spec.rb"
 
 # Supports --autocorrect
 RSpec/ItBehavesLike:
@@ -33490,8 +37377,9 @@
 RSpec/LetBeforeExamples:
   Description: Checks for `let` definitions that come after an example.
   Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '1.16'
-  VersionChanged: '1.22'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
 
 RSpec/LetSetup:
@@ -33503,9 +37391,936 @@
 # Supports --autocorrect
 RSpec/MatchArray:
   Description: Checks where `match_array` is used.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.19'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/autocomplete_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/propagate_integration_project_worker_spec.rb"
 
 RSpec/MessageChain:
   Description: Check that chains of messages are not being stubbed.
@@ -33537,13 +38352,56 @@
 # Supports --autocorrect
 RSpec/MetadataStyle:
   Description: Use consistent metadata style.
-  Enabled: pending
+  Enabled: true
   EnforcedStyle: symbol
   SupportedStyles:
   - hash
   - symbol
   VersionAdded: '2.24'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MetadataStyle
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/models/cloud_connector/access_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/support/stub_settings_source.rb"
 
 RSpec/MissingExampleGroupArgument:
   Description: Checks that the first argument to an example group is not empty.
@@ -33564,6 +38422,25 @@
   - "/home/mch/gitlab-development-kit/gitlab/spec/services/notification_service_spec.rb"
   - "/home/mch/gitlab-development-kit/gitlab/spec/support/shared_examples/graphql/sorted_paginated_query_shared_examples.rb"
 
+RSpec/MissingExpectationTargetMethod:
+  Description: Checks if `.to`, `not_to` or `to_not` are used.
+  Enabled: true
+  VersionAdded: '3.0'
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExpectationTargetMethod
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/lib/ee/gitlab/ci/pipeline/chain/validate/external_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/support/helpers/after_next_helpers.rb"
+
 # Supports --autocorrect
 RSpec/MisspelledAggregateFailures:
   Enabled: true
@@ -37239,7 +42112,7 @@
 
 RSpec/NoExpectationExample:
   Description: Checks if an example contains any expectation.
-  Enabled: pending
+  Enabled: true
   Safe: false
   VersionAdded: '2.13'
   VersionChanged: '2.14'
@@ -37247,6 +42120,188 @@
   AllowedPatterns:
   - "^expect_"
   - "^assert_"
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/features/billings/billing_plans_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/migrate_external_diffs_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/NotToNot:
@@ -37287,9 +42342,37 @@
 
 RSpec/PendingWithoutReason:
   Description: Checks for pending or skipped examples without reason.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.16'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PendingWithoutReason
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/operations_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/rubocop/cop/api/ensure_string_detail_spec.rb"
 
 # Supports --autocorrect
 RSpec/PredicateMatcher:
@@ -37316,10 +42399,627 @@
 # Supports --autocorrect
 RSpec/ReceiveMessages:
   Description: Checks for multiple messages stubbed on the same object.
-  Enabled: pending
+  Enabled: true
   SafeAutoCorrect: false
   VersionAdded: '2.23'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveMessages
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/bin/custom_ability_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/projects/git_garbage_collect_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/ReceiveNever:
@@ -37331,20 +43031,42 @@
 # Supports --autocorrect
 RSpec/RedundantAround:
   Description: Remove redundant `around` hook.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.19'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantAround
 
 # Supports --autocorrect
 RSpec/RedundantPredicateMatcher:
   Description: Checks for redundant predicate matcher.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.26'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RedundantPredicateMatcher
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/lib/gitlab/ci/templates/api_fuzzing_gitlab_ci_yaml_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/models/integrations/field_spec.rb"
 
 RSpec/RemoveConst:
   Description: Checks that `remove_const` is not used in specs.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.26'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RemoveConst
 
@@ -37518,9 +43240,75 @@
 
 RSpec/RepeatedSubjectCall:
   Description: Checks for repeated calls to subject missing that it is memoized.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.27'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedSubjectCall
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/projects/settings/repository_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/stage_update_worker_spec.rb"
 
 # Supports --autocorrect
 RSpec/ReturnFromStub:
@@ -37737,8 +43525,9 @@
 RSpec/ScatteredLet:
   Description: Checks for let scattered across the example group.
   Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '1.14'
-  VersionChanged: '1.39'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
   Exclude:
   - "/home/mch/gitlab-development-kit/gitlab/ee/spec/graphql/types/vulnerability_evidence_supporting_message_type_spec.rb"
@@ -37967,7 +43756,9 @@
 RSpec/ScatteredSetup:
   Description: Checks for setup scattered across multiple hooks in an example group.
   Enabled: true
+  AutoCorrect: contextual
   VersionAdded: '1.10'
+  VersionChanged: '2.31'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
 
 # Supports --autocorrect
@@ -38011,16 +43802,798 @@
 
 RSpec/SkipBlockInsideExample:
   Description: Checks for passing a block to `skip` within examples.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.19'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SkipBlockInsideExample
 
 # Supports --autocorrect
 RSpec/SortMetadata:
   Description: Sort RSpec metadata alphabetically.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.14'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/components/billing/plan_component_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/work_items/copy_timelogs_worker_spec.rb"
 
 RSpec/SpecFilePathFormat:
   Description: Checks that spec file paths are consistent and well-formed.
@@ -38107,9 +44680,116 @@
 
 RSpec/SubjectDeclaration:
   Description: Ensure that subject is defined using subject helper.
-  Enabled: pending
+  Enabled: true
   VersionAdded: '2.5'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectDeclaration
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/features/remote_development/workspaces_dropdown_group_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/groups/update_two_factor_requirement_for_members_worker_spec.rb"
 
 RSpec/SubjectStub:
   Description: Checks for stubbed test subjects.
@@ -38125,6 +44805,14 @@
   - "/home/mch/gitlab-development-kit/gitlab/ee/spec/fixtures/**/*.rb"
   Enabled: true
 
+RSpec/UndescriptiveLiteralsDescription:
+  Description: Description should be descriptive.
+  Enabled: true
+  VersionAdded: '2.29'
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UndescriptiveLiteralsDescription
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/spec/services/merge_requests/base_service_spec.rb"
+
 RSpec/UnspecifiedException:
   Description: Checks for a specified error in checking raised errors.
   Enabled: false
@@ -38167,7 +44855,7 @@
 # Supports --autocorrect
 RSpec/VerifiedDoubleReference:
   Description: Checks for consistent verified double reference style.
-  Enabled: pending
+  Enabled: true
   SafeAutoCorrect: false
   EnforcedStyle: constant
   SupportedStyles:
@@ -38176,6 +44864,278 @@
   VersionAdded: 2.10.0
   VersionChanged: '2.12'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubleReference
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/controllers/groups/analytics/productivity_analytics_controller_spec.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/remove_expired_members_worker_spec.rb"
 
 RSpec/VerifiedDoubles:
   Description: Prefer using verifying doubles over normal doubles.
@@ -39152,16 +46111,6 @@
   VersionAdded: '1.32'
   Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield
 
-# Department 'RSpec/Capybara' (1):
-# Supports --autocorrect
-RSpec/Capybara/FeatureMethods:
-  Description: Checks for consistent method usage in feature specs.
-  Enabled: true
-  EnabledMethods: []
-  VersionAdded: '1.17'
-  VersionChanged: '2.0'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
-
 # Department 'RSpec/FactoryBot' (4):
 RSpec/FactoryBot/AvoidCreate:
   Exclude:
@@ -39860,16 +46809,16 @@
   - spec/factories/**/*.rb
   - ee/spec/factories/**/*.rb
 
-# Department 'RSpec/Rails' (7):
+# Department 'RSpecRails' (7):
 # Supports --autocorrect
-RSpec/Rails/AvoidSetupHook:
+RSpecRails/AvoidSetupHook:
   Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
   Enabled: pending
   VersionAdded: '2.4'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/AvoidSetupHook
 
 # Supports --autocorrect
-RSpec/Rails/HaveHttpStatus:
+RSpecRails/HaveHttpStatus:
   Description: Checks that tests use `have_http_status` instead of equality matchers.
   Enabled: pending
   ResponseMethods:
@@ -39878,10 +46827,10 @@
   SafeAutoCorrect: false
   VersionAdded: '2.12'
   VersionChanged: '2.27'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HaveHttpStatus
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/HaveHttpStatus
 
 # Supports --autocorrect
-RSpec/Rails/HttpStatus:
+RSpecRails/HttpStatus:
   Description: Enforces use of symbolic or numeric value to describe HTTP status.
   Enabled: true
   EnforcedStyle: symbolic
@@ -39891,15 +46840,15 @@
   - be_status
   VersionAdded: '1.23'
   VersionChanged: '2.20'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/HttpStatus
 
 # Supports --autocorrect
-RSpec/Rails/InferredSpecType:
+RSpecRails/InferredSpecType:
   Description: Identifies redundant spec type.
   Enabled: pending
   Safe: false
   VersionAdded: '2.14'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/InferredSpecType
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/InferredSpecType
   Inferences:
     channels: channel
     controllers: controller
@@ -39918,15 +46867,16 @@
     views: view
 
 # Supports --autocorrect
-RSpec/Rails/MinitestAssertions:
+RSpecRails/MinitestAssertions:
   Description: Check if using Minitest-like matchers.
   Enabled: pending
   VersionAdded: '2.17'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/MinitestAssertions
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/MinitestAssertions
 
 # Supports --autocorrect
-RSpec/Rails/NegationBeValid:
+RSpecRails/NegationBeValid:
   Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
+  AutoCorrect: contextual
   Safe: false
   EnforcedStyle: not_to
   SupportedStyles:
@@ -39934,17 +46884,18 @@
   - be_invalid
   Enabled: pending
   VersionAdded: '2.23'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/NegationBeValid
+  VersionChanged: '2.29'
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/NegationBeValid
 
 # Supports --autocorrect
-RSpec/Rails/TravelAround:
+RSpecRails/TravelAround:
   Description: Prefer to travel in `before` rather than `around`.
   Enabled: pending
   Safe: false
   VersionAdded: '2.19'
-  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/TravelAround
+  Reference: https://www.rubydoc.info/gems/rubocop-rspec_rails/RuboCop/Cop/RSpecRails/TravelAround
 
-# Department 'Rails' (133):
+# Department 'Rails' (135):
 # Supports --autocorrect
 Rails/ActionControllerFlashBeforeRender:
   Description: Use `flash.now` instead of `flash` before `render`.
@@ -40211,7 +47162,7 @@
 Rails/Date:
   Description: Checks the correct usage of date aware methods, such as Date.today, Date.current
     etc.
-  Enabled: false
+  Enabled: true
   SafeAutoCorrect: false
   VersionAdded: '0.30'
   VersionChanged: '2.11'
@@ -40220,6 +47171,260 @@
   - strict
   - flexible
   AllowToTime: true
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/app/controllers/users_controller.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/workers/members/expiring_email_notification_worker_spec.rb"
 
 Rails/DefaultScope:
   Description: Avoid use of `default_scope`.
@@ -40313,6 +47518,118 @@
   Include:
   - app/models/**/*.rb
 
+# Supports --autocorrect
+Rails/EnumSyntax:
+  Description: Use positional arguments over keyword arguments when defining enums.
+  Enabled: true
+  Severity: warning
+  VersionAdded: '2.26'
+  Include:
+  - app/models/**/*.rb
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/app/models/abuse_report.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/app/models/zoom_meeting.rb"
+
 Rails/EnumUniqueness:
   Description: Avoid duplicate integers in hash-syntax `enum` declaration.
   Enabled: true

 # Supports --autocorrect
 Rails/FindBy:
@@ -40564,7 +47886,6 @@
   - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/project_template_spec.rb"
   - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/sample_data_template_spec.rb"
   - "/home/mch/gitlab-development-kit/gitlab/spec/migrations/20231003045342_migrate_sidekiq_namespaced_jobs_spec.rb"
-  - "/home/mch/gitlab-development-kit/gitlab/spec/models/ci_platform_metric_spec.rb"
   - "/home/mch/gitlab-development-kit/gitlab/spec/workers/authorized_project_update/user_refresh_over_user_range_worker_spec.rb"
 
 # Supports --autocorrect
@@ -40975,7 +48296,7 @@
   VersionChanged: '2.9'
 
 Rails/NotNullColumn:
-  Description: Do not add a NOT NULL column without a default value.
+  Description: Do not add a NOT NULL column without a default value to existing tables.
   Enabled: true
   VersionAdded: '0.43'
   VersionChanged: '2.20'
@@ -41416,6 +48737,26 @@
   Description: Checks for incorrect grammar when using methods like `3.day.ago`.
   Enabled: true
   VersionAdded: '0.35'
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/app/models/application_setting.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/models/environment_spec.rb"
 
 # Supports --autocorrect
 Rails/Presence:
@@ -41772,8 +49113,9 @@
     for more information.
   Reference: https://guides.rubyonrails.org/active_record_validations.html#skipping-validations
   Enabled: false
+  Safe: false
   VersionAdded: '0.47'
-  VersionChanged: '2.7'
+  VersionChanged: '2.25'
   ForbiddenMethods:
   - decrement!
   - decrement_counter
@@ -42365,8 +49706,9 @@
 
 Rails/UnusedIgnoredColumns:
   Description: Remove a column that does not exist from `ignored_columns`.
-  Enabled: pending
+  Enabled: false
   VersionAdded: '2.11'
+  VersionChanged: '2.25'
   Include:
   - app/models/**/*.rb
 
@@ -42388,13 +49730,13 @@
 
 # Supports --autocorrect
 Rails/WhereEquals:
-  Description: Pass conditions to `where` as a hash instead of manually constructing
-    SQL.
+  Description: Pass conditions to `where` and `where.not` as a hash instead of manually
+    constructing SQL.
   StyleGuide: https://rails.rubystyle.guide/#hash-conditions
   Enabled: true
   SafeAutoCorrect: false
   VersionAdded: '2.9'
-  VersionChanged: '2.10'
+  VersionChanged: '2.26'
 
 # Supports --autocorrect
 Rails/WhereExists:
@@ -42431,6 +49773,96 @@
   VersionAdded: '2.17'
   VersionChanged: '2.18'
 
+# Supports --autocorrect
+Rails/WhereRange:
+  Description: Use ranges in `where` instead of manually constructing SQL.
+  StyleGuide: https://rails.rubystyle.guide/#where-ranges
+  Enabled: true
+  SafeAutoCorrect: false
+  VersionAdded: '2.25'
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/app/finders/events_finder.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/background_migration/batching_strategies/primary_key_batching_strategy_spec.rb"
+
 # Department 'Rake' (1):
 Rake/Require:
   Exclude:
@@ -43163,7 +50595,7 @@
   - app/workers/**/*
   - ee/app/workers/**/*
 
-# Department 'Style' (263):
+# Department 'Style' (268):
 # Supports --autocorrect
 Style/AccessModifierDeclarations:
   Description: Checks style of how access modifiers are used.
@@ -43175,6 +50607,7 @@
   - inline
   - group
   AllowModifiersOnSymbols: true
+  AllowModifiersOnAttrs: true
   SafeAutoCorrect: false
 
 # Supports --autocorrect
@@ -44291,7 +51724,8 @@
   Safe: false
   VersionAdded: '1.2'
   VersionChanged: '1.3'
-  AllowedReceivers: []
+  AllowedReceivers:
+  - params
 
 # Supports --autocorrect
 Style/CollectionMethods:
@@ -44495,6 +51929,7 @@
   Description: Checks for missing documentation comment for public methods.
   Enabled: false
   VersionAdded: '0.43'
+  AllowedMethods: []
   Exclude:
   - "/home/mch/gitlab-development-kit/gitlab/spec/**/*"
   - "/home/mch/gitlab-development-kit/gitlab/test/**/*"
@@ -45953,6 +53388,7 @@
   - never
   - either
   - consistent
+  - either_consistent
   UseHashRocketsWithSymbolValues: false
   PreferHashRocketsForNonAlnumEndingSymbols: false
 
 # Supports --autocorrect
+Style/Iso8601Date:
+  Enabled: true
+
+# Supports --autocorrect
 Style/KeywordParametersOrder:
   Description: Enforces that optional keyword parameters are placed at the end of the
     parameters list.
@@ -49938,6 +57374,26 @@
   VersionAdded: '1.30'
 
 # Supports --autocorrect
+Style/MapIntoArray:
+  Description: Checks for usages of `each` with `<<`, `push`, or `append` which can
+    be replaced by `map`.
+  StyleGuide: "#functional-code"
+  Enabled: true
+  VersionAdded: '1.63'
+  Safe: false
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/app/finders/projects/members/effective_access_level_finder.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/app/services/packages/nuget/extract_metadata_content_service.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/config/settings.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch/node.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/lib/gitlab/git/blame.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/lib/gitlab/grape_logging/loggers/exception_logger.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/lib/google_api/cloud_platform/client.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/qa/qa/tools/delete_user_projects.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/color_schemes_spec.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/themes_spec.rb"
+
+# Supports --autocorrect
 Style/MapToHash:
   Description: Prefer `to_h` with a block over `map.to_h`.
   Enabled: pending
@@ -50867,6 +58323,12 @@
   VersionChanged: '1.30'
 
 # Supports --autocorrect
+Style/RedundantInterpolationUnfreeze:
+  Description: Checks for redundant unfreezing of interpolated strings.
+  Enabled: true
+  VersionAdded: '1.66'
+
+# Supports --autocorrect
 Style/RedundantLineContinuation:
   Description: Check for redundant line continuation.
   Enabled: pending
@@ -51579,6 +59039,25 @@
   VersionAdded: '0.33'
 
 # Supports --autocorrect
+Style/SendWithLiteralMethodName:
+  Description: Detects the use of the `public_send` method with a static method name
+    argument.
+  Enabled: true
+  Safe: false
+  AllowSend: true
+  VersionAdded: '1.64'
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/ee/spec/models/ci/build_spec.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/lib/gitlab/database/load_balancing/connection_proxy.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/lib/sidebars/context.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/lib/api/entities/ci/runner_manager_spec.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/ci/config/entry/retry_spec.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/lib/gitlab/usage_data_counters/web_ide_counter_spec.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/policies/project_policy_spec.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/support/helpers/javascript_fixtures_helpers.rb"
+  - "/home/mch/gitlab-development-kit/gitlab/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb"
+
+# Supports --autocorrect
 Style/SignalException:
   Description: Checks for proper usage of fail and raise.
   StyleGuide: "#prefer-raise-over-fail"
@@ -52167,6 +59646,187 @@
   VersionChanged: '1.20'
 
 # Supports --autocorrect
+Style/SuperArguments:
+  Description: Call `super` without arguments and parentheses when the signature is
+    identical.
+  Enabled: true
+  VersionAdded: '1.64'
+  Exclude:
+  - "/home/mch/gitlab-development-kit/gitlab/app/finders/merge_requests_finder.rb"
...
+  - "/home/mch/gitlab-development-kit/gitlab/tooling/lib/tooling/debug.rb"
+
+# Supports --autocorrect
 Style/SuperWithArgsParentheses:
   Description: Use parentheses for `super` with arguments.
   StyleGuide: "#super-with-args"
@@ -52206,7 +59866,7 @@
   Enabled: true
   Safe: false
   VersionAdded: '0.26'
-  VersionChanged: '1.40'
+  VersionChanged: '1.64'
   AllowMethodsWithArguments: false
   AllowedMethods:
   - define_method
Edited by Martin Schurz

Merge request reports

Loading