Update gitlab-styles to 13.0.1
-
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?
Validating upcoming release of gitlab-styles 13.0.1. See
gitlab-org/ruby/gems/gitlab-styles!237 (merged)
gitlab-org/ruby/gems/gitlab-styles!243 (merged)
This MR can be reused to upgrade gitlab-styles in this project after a new version of gitlab-styles is released.
Checklist
-
Verify upcoming release of gitlab-styles-
Point to "Release" MR of gitlab-stylesinGemfile- For example,
gem 'gitlab-styles', '~> 9.1.0', require: false, git: 'https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles.git', ref: 'ddieulivol-upgrade_to_9.1.0'
- For example,
-
Update bundler's checksum file via bundle exec bundler-checksum init -
rubocopjob-
Inspect any warnings/errors -
(Optional) Generate TODOs for pending offenses -
Put 🆕 cop rules (or if configuration is changed) in "grace period". See docs. -
(Optional) Remove any offenses for disabled cops - Use
grep --perl-regexp -o ":\d+\d+: \w: \[\S+\] ([\w/]+)" raw_job_output.log | awk '{print $4}' | sort | uniq -cto get a list of cop rules with offenses. Whereraw_job_output.logis the raw output of therubocopjob -
Ignore offenses related to temporary changes in Gemfile
-
-
(Optional) Autocorrect offenses -
Compare the total runtime of rubocop --parallelscan with previous runs
-
-
Make sure CI passes 💚 -
Don't merge this MR yet! -
Wait for gitlab-stylesto be released
-
-
Upgrade released version of gitlab-styles-
Make sure release is complete -
Rephrase the title and MR description to match final upgrade -
Point to released version in Gemfile-
gem 'gitlab-styles', '~> 9.1.0', require: false -
Update bundler's checksum file via bundle exec bundler-checksum init
-
-
(Optional) Regenerate TODOs for new/changed cop rules -
Make sure CI passes 💚 -
Let the MR being reviewed again and merged -
(Optional) Refine this MR template.
-
RuboCop configuration diff
-# Available cops (1116) + config for /home/peter/devel/gitlab/gdk/gitlab:
+# Available cops (1130) + config for /home/peter/devel/gitlab/gdk/gitlab:
Click to expand
--- before 2024-10-21 16:09:58.336083727 +0200
+++ after 2024-10-21 16:10:18.375802871 +0200
@@ -1,4 +1,4 @@
-# Available cops (1116) + config for /home/peter/devel/gitlab/gdk/gitlab:
+# Available cops (1130) + config for /home/peter/devel/gitlab/gdk/gitlab:
# Department 'API' (3):
# Supports --autocorrect
API/Base:
@@ -223,12 +223,14 @@
# Department 'CodeReuse' (6):
CodeReuse/ActiveRecord:
+ Enabled: true
Exclude:
- "/home/peter/devel/gitlab/gdk/gitlab/app/models/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/config/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/db/**/*.rb"
- - "/home/peter/devel/gitlab/gdk/gitlab/lib/tasks/**/*.rake"
+ - "/home/peter/devel/gitlab/gdk/gitlab/lib/tasks/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/spec/**/*.rb"
+ - "/home/peter/devel/gitlab/gdk/gitlab/lib/tasks/**/*.rake"
- "/home/peter/devel/gitlab/gdk/gitlab/danger/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/lib/backup/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/lib/banzai/**/*.rb"
@@ -252,7 +254,6 @@
- "/home/peter/devel/gitlab/gdk/gitlab/ee/lib/tasks/**/*.rake"
- "/home/peter/devel/gitlab/gdk/gitlab/ee/lib/ee/gitlab/background_migration/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/ee/lib/gitlab/usage/metrics/instrumentations/**/*.rb"
- Enabled: true
CodeReuse/Finder:
Enabled: true
@@ -269,7 +270,7 @@
CodeReuse/Worker:
Enabled: true
-# Department 'Cop' (39):
+# Department 'Cop' (38):
Cop/ActiveModelErrorsDirectManipulation:
Enabled: true
@@ -475,9 +476,6 @@
- "/home/peter/devel/gitlab/gdk/gitlab/spec/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/ee/spec/**/*.rb"
-Cop/WithoutReactiveCache:
- Enabled: false
-
# Department 'Database' (7):
Database/AvoidInheritanceColumn:
Enabled: true
@@ -557,6 +555,7 @@
FactoryBot/CreateList:
Description: Checks for create_list usage.
Enabled: true
+ AutoCorrect: contextual
Include:
- "**/*_spec.rb"
- "**/spec/**/*"
@@ -569,12 +568,12 @@
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:
Description: Check for excessive model creation in a list.
- Enabled: pending
+ Enabled: true
Include:
- "**/*_spec.rb"
- "**/spec/**/*"
@@ -671,7 +670,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
@@ -1325,7 +1334,17 @@
- "/home/peter/devel/gitlab/gdk/gitlab/lib/gitlab/graphql/authorize/authorize_resource.rb"
Enabled: true
-# Department 'InternalAffairs' (3):
+# Department 'InternalAffairs' (5):
+# Supports --autocorrect
+InternalAffairs/CopDescription:
+ Enabled: false
+
+# Supports --autocorrect
+InternalAffairs/CopDescriptionWithExample:
+ Enabled: true
+ Include:
+ - lib/rubocop/cop/**/*.rb
+
InternalAffairs/DeprecateCopHelper:
Include:
- spec/rubocop/**/*.rb
@@ -1747,6 +1766,7 @@
Enabled: false
VersionAdded: '0.49'
AllowMultilineFinalElement: false
+ AllowedMethods: []
# Supports --autocorrect
Layout/FirstMethodParameterLineBreak:
@@ -1858,6 +1878,7 @@
VersionChanged: '0.73'
AllowDoxygenCommentStyle: false
AllowGemfileRubyComment: false
+ AllowRBSInlineAnnotation: false
# Supports --autocorrect
Layout/LeadingEmptyLines:
@@ -2357,7 +2378,7 @@
VersionChanged: '1.0'
AllowInHeredoc: false
-# Department 'Lint' (137):
+# Department 'Lint' (139):
Lint/AmbiguousAssignment:
Description: Checks for mistyped shorthand assignments.
Enabled: true
@@ -2471,7 +2492,7 @@
Description: Check for debugger calls.
Enabled: true
VersionAdded: '0.14'
- VersionChanged: '1.46'
+ VersionChanged: '1.63'
DebuggerMethods:
Kernel:
- binding.irb
@@ -2482,8 +2503,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
@@ -2506,6 +2533,10 @@
WebConsole:
- binding.console
PryShell: binding.pry_shell
+ DebuggerRequires:
+ debug.rb:
+ - debug/open
+ - debug/start
# Supports --autocorrect
Lint/DeprecatedClassMethods:
@@ -2616,6 +2647,12 @@
Enabled: true
VersionAdded: '0.89'
+# Supports --autocorrect
+Lint/DuplicateSetElement:
+ Description: Checks for duplicate elements in Set.
+ Enabled: pending
+ VersionAdded: '1.67'
+
Lint/EachWithObjectArgument:
Description: Check for immutable argument given to each_with_object.
Enabled: true
@@ -2697,7 +2734,6 @@
VersionAdded: '0.45'
VersionChanged: '0.83'
-# Supports --autocorrect
Lint/EnsureReturn:
Description: Do not use return in an ensure block.
StyleGuide: "#no-return-ensure"
@@ -2755,6 +2791,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.
@@ -3153,9 +3190,9 @@
# Supports --autocorrect
Lint/SafeNavigationConsistency:
- Description: Check to make sure that if safe navigation is used for a method call
- in an `&&` or `||` condition that safe navigation is used for all method calls on
- that same object.
+ Description: Check to make sure that if safe navigation is used in an `&&` or `||`
+ condition, consistent and appropriate safe navigation, without excess or deficiency,
+ is used for all method calls on the same object.
Enabled: true
VersionAdded: '0.55'
VersionChanged: '0.77'
@@ -3377,8 +3414,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`.
@@ -3395,6 +3431,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
@@ -3470,8 +3512,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:
@@ -3855,6 +3898,7 @@
VersionAdded: '0.50'
VersionChanged: '1.23'
Exclude:
+ - "/home/peter/devel/gitlab/gdk/gitlab/Rakefile.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/**/*/*.builder"
- "/home/peter/devel/gitlab/gdk/gitlab/ee/bin/*"
- "/home/peter/devel/gitlab/gdk/gitlab/config.ru"
@@ -4067,7 +4111,8 @@
- is_
- has_
- have_
- ForbiddenPrefixes: is_
+ ForbiddenPrefixes:
+ - is_
AllowedMethods:
- is_a?
MethodDefinitionMacros:
@@ -4199,6 +4244,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
@@ -4555,7 +4601,7 @@
Exclude:
- "/home/peter/devel/gitlab/gdk/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.
@@ -4617,14 +4663,16 @@
# 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
# 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'
@@ -4642,7 +4690,7 @@
# Supports --autocorrect
RSpec/BeNil:
Description: Ensures a consistent style is used when matching `nil`.
- Enabled: pending
+ Enabled: true
EnforcedStyle: be_nil
SupportedStyles:
- be
@@ -4696,7 +4744,7 @@
# 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
@@ -4717,7 +4765,7 @@
# 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
@@ -4813,8 +4861,14 @@
# Supports --autocorrect
RSpec/Dialect:
Description: Enforces custom RSpec dialects.
- Enabled: false
- PreferredMethods: {}
+ Enabled: true
+ PreferredMethods:
+ background: :before
+ scenario: :it
+ xscenario: :xit
+ given: :let
+ given!: :let!
+ feature: :describe
VersionAdded: '1.33'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Dialect
@@ -4824,7 +4878,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
@@ -4832,16 +4886,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
@@ -4898,11 +4955,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:
@@ -4931,7 +4997,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
@@ -4951,7 +5017,7 @@
RSpec/ExampleWithoutDescription:
Description: Checks for examples without a description.
Enabled: true
- EnforcedStyle: always_allow
+ EnforcedStyle: single_line_only
SupportedStyles:
- always_allow
- single_line_only
@@ -4980,7 +5046,7 @@
# 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
@@ -5016,6 +5082,12 @@
VersionAdded: '1.16'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook
+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
+
RSpec/ExpectOutput:
Description: Checks for opportunities to use `expect { ... }.to output`.
Enabled: true
@@ -5037,34 +5109,13 @@
- "/home/peter/devel/gitlab/gdk/gitlab/qa/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/gems/**/*.rb"
-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/peter/devel/gitlab/gdk/gitlab/qa/**/*"
- - "/home/peter/devel/gitlab/gdk/gitlab/spec/frontend/fixtures/*"
- - "/home/peter/devel/gitlab/gdk/gitlab/ee/spec/frontend/fixtures/*"
- - "/home/peter/devel/gitlab/gdk/gitlab/spec/requests/api/v3/*"
- - "/home/peter/devel/gitlab/gdk/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
@@ -5101,12 +5152,14 @@
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
@@ -5145,7 +5198,7 @@
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
@@ -5172,7 +5225,7 @@
# 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
@@ -5214,8 +5267,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:
@@ -5227,7 +5281,7 @@
# Supports --autocorrect
RSpec/MatchArray:
Description: Checks where `match_array` is used.
- Enabled: pending
+ Enabled: false
VersionAdded: '2.19'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MatchArray
@@ -5261,7 +5315,7 @@
# Supports --autocorrect
RSpec/MetadataStyle:
Description: Use consistent metadata style.
- Enabled: pending
+ Enabled: true
EnforcedStyle: symbol
SupportedStyles:
- hash
@@ -5275,6 +5329,12 @@
VersionAdded: '1.28'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
+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
+
# Supports --autocorrect
RSpec/MisspelledAggregateFailures:
Enabled: true
@@ -5338,7 +5398,7 @@
RSpec/NoExpectationExample:
Description: Checks if an example contains any expectation.
- Enabled: pending
+ Enabled: true
Safe: false
VersionAdded: '2.13'
VersionChanged: '2.14'
@@ -5372,7 +5432,7 @@
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
@@ -5401,7 +5461,7 @@
# 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
@@ -5416,20 +5476,20 @@
# 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
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
@@ -5465,7 +5525,7 @@
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
@@ -5485,15 +5545,18 @@
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
# Supports --autocorrect
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
@@ -5534,27 +5597,33 @@
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: false
VersionAdded: '2.14'
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SortMetadata
RSpec/SpecFilePathFormat:
Description: Checks that spec file paths are consistent and well-formed.
- Enabled: false
+ Enabled: true
Include:
- "**/*_spec.rb"
Exclude:
- "**/spec/routing/**/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/qa/**/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/spec/frontend/fixtures/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/ee/spec/frontend/fixtures/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/spec/requests/api/v3/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/spec/fixtures/**/*"
CustomTransform:
RuboCop: rubocop
RSpec: rspec
+ HTTPartyBasicAuth: httparty_basic_auth
IgnoreMethods: true
IgnoreMetadata:
type: routing
@@ -5563,12 +5632,18 @@
RSpec/SpecFilePathSuffix:
Description: Checks that spec file paths suffix are consistent and well-formed.
- Enabled: false
+ Enabled: true
VersionAdded: '2.24'
Include:
- "**/*_spec*rb*"
- "**/spec/**/*"
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathSuffix
+ Exclude:
+ - "/home/peter/devel/gitlab/gdk/gitlab/qa/**/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/spec/frontend/fixtures/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/ee/spec/frontend/fixtures/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/spec/requests/api/v3/*"
+ - "/home/peter/devel/gitlab/gdk/gitlab/spec/fixtures/**/*"
# Supports --autocorrect
RSpec/SpecifyExpected:
@@ -5582,7 +5657,7 @@
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
@@ -5600,6 +5675,12 @@
- "/home/peter/devel/gitlab/gdk/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
+
RSpec/UnspecifiedException:
Description: Checks for a specified error in checking raised errors.
Enabled: false
@@ -5642,7 +5723,7 @@
# Supports --autocorrect
RSpec/VerifiedDoubleReference:
Description: Checks for consistent verified double reference style.
- Enabled: pending
+ Enabled: true
SafeAutoCorrect: false
EnforcedStyle: constant
SupportedStyles:
@@ -5684,16 +5765,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:
Enabled: true
@@ -5734,16 +5805,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:
@@ -5752,10 +5823,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
@@ -5765,15 +5836,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
@@ -5792,15 +5863,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:
@@ -5808,17 +5880,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`.
@@ -5959,7 +6032,7 @@
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.49'
- VersionChanged: '2.5'
+ VersionChanged: '2.26'
Exclude:
- "/home/peter/devel/gitlab/gdk/gitlab/db/**/*.rb"
- "/home/peter/devel/gitlab/gdk/gitlab/lib/gitlab/background_migration/**/*.rb"
@@ -6075,7 +6148,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'
@@ -6177,6 +6250,15 @@
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
+
Rails/EnumUniqueness:
Description: Avoid duplicate integers in hash-syntax `enum` declaration.
Enabled: true
@@ -6493,7 +6575,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'
@@ -6848,8 +6930,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
@@ -7028,8 +7111,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
@@ -7051,13 +7135,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:
@@ -7094,6 +7178,14 @@
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'
+
# Department 'Rake' (1):
Rake/Require:
Enabled: true
@@ -7205,7 +7297,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.
@@ -7217,6 +7309,7 @@
- inline
- group
AllowModifiersOnSymbols: true
+ AllowModifiersOnAttrs: true
SafeAutoCorrect: false
# Supports --autocorrect
@@ -7499,7 +7592,8 @@
Safe: false
VersionAdded: '1.2'
VersionChanged: '1.3'
- AllowedReceivers: []
+ AllowedReceivers:
+ - params
# Supports --autocorrect
Style/CollectionMethods:
@@ -7696,6 +7790,7 @@
Description: Checks for missing documentation comment for public methods.
Enabled: false
VersionAdded: '0.43'
+ AllowedMethods: []
Exclude:
- "/home/peter/devel/gitlab/gdk/gitlab/spec/**/*"
- "/home/peter/devel/gitlab/gdk/gitlab/test/**/*"
@@ -8066,7 +8161,7 @@
StyleGuide: "#hash-literals"
Enabled: true
VersionAdded: '0.9'
- VersionChanged: '1.24'
+ VersionChanged: '1.67'
EnforcedStyle: ruby19
SupportedStyles:
- ruby19
@@ -8079,6 +8174,7 @@
- never
- either
- consistent
+ - either_consistent
UseHashRocketsWithSymbolValues: false
PreferHashRocketsForNonAlnumEndingSymbols: false
@@ -8239,6 +8335,10 @@
- "/home/peter/devel/gitlab/gdk/gitlab/**/*.gemspec"
# 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.
@@ -8302,6 +8402,16 @@
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'
+ VersionChanged: '1.67'
+ Safe: false
+
+# Supports --autocorrect
Style/MapToHash:
Description: Prefer `to_h` with a block over `map.to_h`.
Enabled: pending
@@ -9042,6 +9152,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
@@ -9206,6 +9322,7 @@
AllowedMethods: []
AllowedPatterns: []
VersionAdded: '1.53'
+ VersionChanged: '1.67'
# Supports --autocorrect
Style/SafeNavigation:
@@ -9214,7 +9331,7 @@
the object will be `nil` or truthy, but never `false`.
Enabled: false
VersionAdded: '0.43'
- VersionChanged: '1.27'
+ VersionChanged: '1.67'
ConvertCodeThatCanStartToReturnNil: false
AllowedMethods:
- present?
@@ -9264,6 +9381,15 @@
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'
+
+# Supports --autocorrect
Style/SignalException:
Description: Checks for proper usage of fail and raise.
StyleGuide: "#prefer-raise-over-fail"
@@ -9453,6 +9579,13 @@
VersionChanged: '1.20'
# Supports --autocorrect
+Style/SuperArguments:
+ Description: Call `super` without arguments and parentheses when the signature is
+ identical.
+ Enabled: true
+ VersionAdded: '1.64'
+
+# Supports --autocorrect
Style/SuperWithArgsParentheses:
Description: Use parentheses for `super` with arguments.
StyleGuide: "#super-with-args"
@@ -9492,7 +9625,7 @@
Enabled: true
Safe: false
VersionAdded: '0.26'
- VersionChanged: '1.40'
+ VersionChanged: '1.64'
AllowMethodsWithArguments: false
AllowedMethods:
- define_method
@@ -9738,6 +9871,10 @@
VersionAdded: '0.37'
VersionChanged: '0.39'
+# Department 'Tailwind' (1):
+Tailwind/StringInterpolation:
+ Enabled: false
+
# Department 'UsageData' (4):
UsageData/DistinctCountByLargeForeignKey:
Enabled: true
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
After merge
-
Notify team members of the upgrade by creating an announcement in relevant Slack channels ( #backendand#development) and Engineering Week In Review (EWIR).
Edited by Peter Leitzen