From 10881a7ddeae1c7235fba8f960514685d53652d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 19:53:33 +0000 Subject: [PATCH 1/5] Bump rubocop from 1.57.1 to 1.59.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.1 to 1.59.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.57.1...v1.59.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 14 +++++------- test/fixtures/full_config.yml | 41 +++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a3a65995..e0ab6bc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,11 +8,10 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - base64 (0.1.1) byebug (11.1.3) coderay (1.1.3) diffy (3.4.2) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) method_source (1.0.0) minitest (5.20.0) @@ -26,13 +25,12 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - racc (1.7.1) + racc (1.7.3) rainbow (3.1.1) rake (13.1.0) - regexp_parser (2.8.2) + regexp_parser (2.8.3) rexml (3.2.6) - rubocop (1.57.1) - base64 (~> 0.1.1) + rubocop (1.59.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -40,10 +38,10 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) unicode-display_width (2.5.0) diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index b7ef7fca..b7296ce1 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -922,6 +922,10 @@ Layout/SpaceAroundOperators: SupportedStylesForExponentOperator: - space - no_space + EnforcedStyleForRationalLiterals: no_space + SupportedStylesForRationalLiterals: + - space + - no_space Layout/SpaceBeforeBlockBraces: Description: Checks that the left block brace has or doesn't have space before it. Enabled: true @@ -1418,6 +1422,11 @@ Lint/InterpolationCheck: SafeAutoCorrect: false VersionAdded: '0.50' VersionChanged: '1.40' +Lint/ItWithoutArgumentsInBlock: + Description: Checks uses of `it` calls without arguments in block. + Reference: https://bugs.ruby-lang.org/issues/18980 + Enabled: pending + VersionAdded: '1.59' Lint/LambdaWithoutLiteralBlock: Description: Checks uses of lambda without a literal block. Enabled: false @@ -1426,6 +1435,10 @@ Lint/LiteralAsCondition: Description: Checks of literals used in conditions. Enabled: true VersionAdded: '0.51' +Lint/LiteralAssignmentInCondition: + Description: Checks for literal assignments in the conditions. + Enabled: pending + VersionAdded: '1.58' Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. Enabled: true @@ -2344,7 +2357,19 @@ Style/ArgumentsForwarding: Enabled: false AllowOnlyRestArgument: true UseAnonymousForwarding: true + RedundantRestArgumentNames: + - args + - arguments + RedundantKeywordRestArgumentNames: + - kwargs + - options + - opts + RedundantBlockArgumentNames: + - blk + - block + - proc VersionAdded: '1.1' + VersionChanged: '1.58' Style/ArrayCoercion: Description: Use Array() instead of explicit Array check or [*var], when dealing with a variable you want to treat as an Array, but you're not certain it's an @@ -2353,6 +2378,12 @@ Style/ArrayCoercion: Safe: false Enabled: false VersionAdded: '0.88' +Style/ArrayFirstLast: + Description: Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`. + Reference: "#first-and-last" + Enabled: false + VersionAdded: '1.58' + Safe: false Style/ArrayIntersect: Description: Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`. Enabled: true @@ -3710,7 +3741,7 @@ Style/RedundantFetchBlock: Description: Use `fetch(key, value)` instead of `fetch(key) { value }` when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant. - Reference: https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code + Reference: https://github.com/fastruby/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code Enabled: false Safe: false SafeForConstants: false @@ -3885,7 +3916,7 @@ Style/SafeNavigation: MaxChainLength: 2 Style/Sample: Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`. - Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code + Reference: https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code Enabled: true VersionAdded: '0.30' Style/SelectByRegexp: @@ -3943,6 +3974,7 @@ Style/SingleLineBlockParams: - elem Style/SingleLineDoEndBlock: Description: Checks for single-line `do`...`end` blocks. + StyleGuide: "#single-line-do-end-block" Enabled: true VersionAdded: '1.57' Style/SingleLineMethods: @@ -4058,6 +4090,11 @@ Style/StructInheritance: SafeAutoCorrect: false VersionAdded: '0.29' VersionChanged: '1.20' +Style/SuperWithArgsParentheses: + Description: Use parentheses for `super` with arguments. + StyleGuide: "#super-with-args" + Enabled: pending + VersionAdded: '1.58' Style/SwapValues: Description: Enforces the use of shorthand-style swapping of 2 variables. StyleGuide: "#values-swapping" From 759f43434046780e162eac6f41e60545e9e146f6 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 11 Dec 2023 15:09:29 -0500 Subject: [PATCH 2/5] Extract v1_57 local variable Rather than repeat `Gem::Version.new(...)` every time we want to check a version, we can extract a variable. --- rubocop.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rubocop.yml b/rubocop.yml index 6ed54bea..3ddb2c08 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,4 +1,7 @@ -<% rubocop_version = Gem.loaded_specs.fetch("rubocop").version %> +<% + rubocop_version = Gem.loaded_specs.fetch("rubocop").version + v1_57 = Gem::Version.new("1.57") +%> inherit_mode: merge: @@ -796,7 +799,7 @@ Style/SelectByRegexp: Style/SingleArgumentDig: Enabled: false -<% if rubocop_version >= Gem::Version.new('1.57') %> +<% if rubocop_version >= v1_57 %> Style/SingleLineDoEndBlock: Enabled: true <% end %> From 2d34a7804d2aef55c5ecd5e56b7943e338e7fb69 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 11 Dec 2023 15:11:36 -0500 Subject: [PATCH 3/5] Enable `Lint/LiteralAssignmentInCondition` --- rubocop.yml | 6 ++++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index 3ddb2c08..2d6e9bbf 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,6 +1,7 @@ <% rubocop_version = Gem.loaded_specs.fetch("rubocop").version v1_57 = Gem::Version.new("1.57") + v1_58 = Gem::Version.new("1.58") %> inherit_mode: @@ -191,6 +192,11 @@ Lint/InterpolationCheck: Lint/LambdaWithoutLiteralBlock: Enabled: false +<% if rubocop_version >= v1_58 %> +Lint/LiteralAssignmentInCondition: + Enabled: true +<% end %> + Lint/MixedCaseRange: Enabled: true diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index b7296ce1..96dfbc93 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1437,7 +1437,7 @@ Lint/LiteralAsCondition: VersionAdded: '0.51' Lint/LiteralAssignmentInCondition: Description: Checks for literal assignments in the conditions. - Enabled: pending + Enabled: true VersionAdded: '1.58' Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. From b5630b85e73405d3f1326c6d151f82d304ae3331 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 11 Dec 2023 15:11:55 -0500 Subject: [PATCH 4/5] Enable `Style/SuperWithArgsParentheses` --- 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 2d6e9bbf..a5558b34 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -834,6 +834,11 @@ Style/StringLiteralsInInterpolation: Style/StructInheritance: Enabled: false +<% if rubocop_version >= v1_58 %> +Style/SuperWithArgsParentheses: + Enabled: true +<% end %> + Style/SwapValues: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index 96dfbc93..b92e9612 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -4093,7 +4093,7 @@ Style/StructInheritance: Style/SuperWithArgsParentheses: Description: Use parentheses for `super` with arguments. StyleGuide: "#super-with-args" - Enabled: pending + Enabled: true VersionAdded: '1.58' Style/SwapValues: Description: Enforces the use of shorthand-style swapping of 2 variables. From 33ba911a65e7f2e8560986be6e693fd060a3652e Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Mon, 11 Dec 2023 15:12:18 -0500 Subject: [PATCH 5/5] Enable `Lint/ItWithoutArgumentsInBlock` --- rubocop.yml | 6 ++++++ test/fixtures/full_config.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rubocop.yml b/rubocop.yml index a5558b34..e02dfd30 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -2,6 +2,7 @@ rubocop_version = Gem.loaded_specs.fetch("rubocop").version v1_57 = Gem::Version.new("1.57") v1_58 = Gem::Version.new("1.58") + v1_59 = Gem::Version.new("1.59") %> inherit_mode: @@ -189,6 +190,11 @@ Lint/IncompatibleIoSelectWithFiberScheduler: Lint/InterpolationCheck: Enabled: false +<% if rubocop_version >= v1_59 %> +Lint/ItWithoutArgumentsInBlock: + Enabled: true +<% end %> + Lint/LambdaWithoutLiteralBlock: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index b92e9612..b94dd9bf 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1425,7 +1425,7 @@ Lint/InterpolationCheck: Lint/ItWithoutArgumentsInBlock: Description: Checks uses of `it` calls without arguments in block. Reference: https://bugs.ruby-lang.org/issues/18980 - Enabled: pending + Enabled: true VersionAdded: '1.59' Lint/LambdaWithoutLiteralBlock: Description: Checks uses of lambda without a literal block.