From fdff86c0950b58886a69da72de0a347ccfd72362 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:36:38 +0000 Subject: [PATCH 1/9] Bump rubocop from 1.75.8 to 1.76.0 in the rubocop group Bumps the rubocop group with 1 update: [rubocop](https://github.com/rubocop/rubocop). Updates `rubocop` from 1.75.8 to 1.76.0 - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.75.8...v1.76.0) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.76.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rubocop ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 ++-- test/fixtures/full_config.yml | 58 ++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 681746c1..655fed4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,7 +24,7 @@ GEM rainbow (3.1.1) rake (13.3.0) regexp_parser (2.10.0) - rubocop (1.75.8) + rubocop (1.76.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -32,10 +32,10 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.45.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.45.0) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-minitest (0.38.1) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 0a5972a3..4ca6ec94 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1387,7 +1387,7 @@ Lint/EmptyInterpolation: Enabled: true AutoCorrect: contextual VersionAdded: '0.20' - VersionChanged: '1.61' + VersionChanged: '1.76' Lint/EmptyWhen: Description: Checks for `when` branches with empty bodies. Enabled: false @@ -1794,6 +1794,7 @@ Lint/ShadowingOuterLocalVariable: or block local variables. Enabled: false VersionAdded: '0.9' + VersionChanged: '1.76' Lint/SharedMutableDefault: Description: Checks for mutable literals used as default arguments during Hash initialization. StyleGuide: "#no-mutable-defaults" @@ -1954,6 +1955,13 @@ Lint/UselessConstantScoping: Description: Checks for useless constant scoping. Enabled: false VersionAdded: '1.72' +Lint/UselessDefaultValueArgument: + Description: Checks for usage of `fetch` or `Array.new` with default value argument + and block. + Enabled: pending + VersionAdded: '1.76' + Safe: false + AllowedReceivers: [] Lint/UselessDefined: Description: Checks for calls to `defined?` with strings and symbols. The result of such a call will always be truthy. @@ -1975,6 +1983,10 @@ Lint/UselessNumericOperation: Description: Checks for useless numeric operations. Enabled: false VersionAdded: '1.66' +Lint/UselessOr: + Description: Checks for useless OR expressions. + Enabled: pending + VersionAdded: '1.76' Lint/UselessRescue: Description: Checks for useless `rescue`s. Enabled: false @@ -2309,16 +2321,30 @@ Naming/MethodParameterName: - pp - to ForbiddenNames: [] -Naming/PredicateName: - Description: Check the names of predicate methods. +Naming/PredicateMethod: + Description: Checks that predicate methods end with `?` and non-predicate methods + do not. + Enabled: pending + VersionAdded: '1.76' + Mode: conservative + AllowedMethods: + - call +Naming/PredicatePrefix: + Description: Predicate method names should not be prefixed and end with a `?`. StyleGuide: "#bool-methods-qmark" - Enabled: false + Enabled: true VersionAdded: '0.50' VersionChanged: '1.75' NamePrefix: - is_ + - has_ + - have_ + - does_ ForbiddenPrefixes: - is_ + - has_ + - have_ + - does_ AllowedMethods: - is_a? MethodDefinitionMacros: @@ -2943,6 +2969,15 @@ Style/EmptyMethod: SupportedStyles: - compact - expanded +Style/EmptyStringInsideInterpolation: + Description: Checks for empty strings being assigned inside string interpolation. + StyleGuide: "#empty-strings-in-interpolation" + Enabled: pending + EnforcedStyle: trailing_conditional + SupportedStyles: + - trailing_conditional + - ternary + VersionAdded: '1.76' Style/Encoding: Description: Use UTF-8 as the source file encoding. StyleGuide: "#utf-8" @@ -3331,12 +3366,14 @@ Style/ItBlockParameter: Description: Checks for blocks with one argument where `it` block parameter can be used. Enabled: false - EnforcedStyle: only_numbered_parameters + EnforcedStyle: allow_single_line SupportedStyles: + - allow_single_line - only_numbered_parameters - always - disallow VersionAdded: '1.75' + VersionChanged: '1.76' Style/KeywordArgumentsMerging: Description: When passing an existing hash as keyword arguments, provide additional arguments directly rather than using `merge`. @@ -3908,6 +3945,11 @@ Style/RedundantArrayConstructor: Description: Checks for the instantiation of array using redundant `Array` constructor. Enabled: false VersionAdded: '1.52' +Style/RedundantArrayFlatten: + Description: Checks for redundant calls of `Array#flatten`. + Enabled: pending + Safe: false + VersionAdded: '1.76' Style/RedundantAssignment: Description: Checks for redundant assignment before returning. Enabled: false @@ -4616,3 +4658,9 @@ inherit_mode: merge: - Exclude - Include +Naming/PredicateName: + Enabled: false + NamePrefix: + - is_ + ForbiddenPrefixes: + - is_ From ee416ca43e62cd9ad5d53124e09d008506bfad4a Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 11:46:48 -0400 Subject: [PATCH 2/9] Handle `Naming/Predicate{Naming,Prefix}` rename This cop has been renamed, so we conditionally set the config depending on RuboCop version. --- rubocop.yml | 4 ++++ test/fixtures/full_config.yml | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index cb49108d..fe6a7fda 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -558,7 +558,11 @@ Naming/MethodName: Naming/MethodParameterName: Enabled: false +<% if rubocop_version >= "1.76" %> +Naming/PredicatePrefix: +<% else %> Naming/PredicateName: +<% end %> Enabled: false NamePrefix: - is_ diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 4ca6ec94..c5a7edfa 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2332,19 +2332,13 @@ Naming/PredicateMethod: Naming/PredicatePrefix: Description: Predicate method names should not be prefixed and end with a `?`. StyleGuide: "#bool-methods-qmark" - Enabled: true + Enabled: false VersionAdded: '0.50' VersionChanged: '1.75' NamePrefix: - is_ - - has_ - - have_ - - does_ ForbiddenPrefixes: - is_ - - has_ - - have_ - - does_ AllowedMethods: - is_a? MethodDefinitionMacros: @@ -4658,9 +4652,3 @@ inherit_mode: merge: - Exclude - Include -Naming/PredicateName: - Enabled: false - NamePrefix: - - is_ - ForbiddenPrefixes: - - is_ From 16502a2dee45917138293c0acae2f679672a2a07 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:00:03 -0400 Subject: [PATCH 3/9] Support `dev test` --- dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev.yml b/dev.yml index 1fd373ab..d551f7f6 100644 --- a/dev.yml +++ b/dev.yml @@ -1,3 +1,5 @@ up: - ruby - bundler + +test: bundle exec rake From 487ed0fc1fd364d2ac053afb870219ff2aaa982e Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:00:20 -0400 Subject: [PATCH 4/9] Conditionally configure `Lint/ShadowingOuterLocalVariable` As of `rubocop@1.76`, our config matches the default, so we should not configure it. --- rubocop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rubocop.yml b/rubocop.yml index fe6a7fda..27963f33 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -378,8 +378,10 @@ Lint/ShadowedArgument: Lint/ShadowedException: Enabled: false +<% if rubocop_version < "1.76" %> Lint/ShadowingOuterLocalVariable: Enabled: false +<% end %> Lint/SharedMutableDefault: Enabled: false From a6ad200ac8fef7fc9f4c0437e2432b935a1f57de Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:01:46 -0400 Subject: [PATCH 5/9] Enable pending `Lint/UselessDefaultValueArgument` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 27963f33..97c6d8af 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -452,6 +452,11 @@ Lint/UselessAssignment: Lint/UselessConstantScoping: Enabled: false +<% if rubocop_version >= "1.76" %> +Lint/UselessDefaultValueArgument: + Enabled: true +<% end %> + Lint/UselessDefined: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index c5a7edfa..9c49f1fc 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1958,7 +1958,7 @@ Lint/UselessConstantScoping: Lint/UselessDefaultValueArgument: Description: Checks for usage of `fetch` or `Array.new` with default value argument and block. - Enabled: pending + Enabled: true VersionAdded: '1.76' Safe: false AllowedReceivers: [] From 0e9597fd5af6c96e74831c756407eee0d3b4a157 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:02:05 -0400 Subject: [PATCH 6/9] Enable pending `Lint/UselessOr` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 97c6d8af..a0d7fde2 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -469,6 +469,11 @@ Lint/UselessMethodDefinition: Lint/UselessNumericOperation: Enabled: false +<% if rubocop_version >= "1.76" %> +Lint/UselessOr: + Enabled: true +<% end %> + Lint/UselessRescue: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 9c49f1fc..624038dd 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1985,7 +1985,7 @@ Lint/UselessNumericOperation: VersionAdded: '1.66' Lint/UselessOr: Description: Checks for useless OR expressions. - Enabled: pending + Enabled: true VersionAdded: '1.76' Lint/UselessRescue: Description: Checks for useless `rescue`s. From 89cd2220c8939561f2ce65941f6b4dc080ef32d8 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:02:29 -0400 Subject: [PATCH 7/9] Disable pending `Naming/PredicateMethod` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index a0d7fde2..33219cbd 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -570,6 +570,11 @@ Naming/MethodName: Naming/MethodParameterName: Enabled: false +<% if rubocop_version >= "1.76" %> +Naming/PredicateMethod: + Enabled: false +<% end %> + <% if rubocop_version >= "1.76" %> Naming/PredicatePrefix: <% else %> diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 624038dd..1234a435 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2324,7 +2324,7 @@ Naming/MethodParameterName: Naming/PredicateMethod: Description: Checks that predicate methods end with `?` and non-predicate methods do not. - Enabled: pending + Enabled: false VersionAdded: '1.76' Mode: conservative AllowedMethods: From b8232718d85247d8766fa700e8541a0d54928e66 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:02:48 -0400 Subject: [PATCH 8/9] Disable pending `Style/EmptyStringInsideInterpolation` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 33219cbd..e601320c 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -789,6 +789,11 @@ Style/EmptyLiteral: Style/EmptyMethod: Enabled: false +<% if rubocop_version >= "1.76" %> +Style/EmptyStringInsideInterpolation: + Enabled: false +<% end %> + Style/Encoding: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 1234a435..732f9c37 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -2966,7 +2966,7 @@ Style/EmptyMethod: Style/EmptyStringInsideInterpolation: Description: Checks for empty strings being assigned inside string interpolation. StyleGuide: "#empty-strings-in-interpolation" - Enabled: pending + Enabled: false EnforcedStyle: trailing_conditional SupportedStyles: - trailing_conditional From ccbb378d69d4240533337884f1446d0779c117ce Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 5 Jun 2025 12:03:04 -0400 Subject: [PATCH 9/9] Enable pending `Style/ReduntantArrayFlatten` --- rubocop.yml | 5 +++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index e601320c..bb987db2 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1138,6 +1138,11 @@ Style/RedundantArgument: Style/RedundantArrayConstructor: Enabled: false +<% if rubocop_version >= "1.76" %> +Style/RedundantArrayFlatten: + Enabled: true +<% end %> + Style/RedundantAssignment: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 732f9c37..e7b63f15 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -3941,7 +3941,7 @@ Style/RedundantArrayConstructor: VersionAdded: '1.52' Style/RedundantArrayFlatten: Description: Checks for redundant calls of `Array#flatten`. - Enabled: pending + Enabled: true Safe: false VersionAdded: '1.76' Style/RedundantAssignment: