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/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 diff --git a/rubocop.yml b/rubocop.yml index cb49108d..bb987db2 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 @@ -450,6 +452,11 @@ Lint/UselessAssignment: Lint/UselessConstantScoping: Enabled: false +<% if rubocop_version >= "1.76" %> +Lint/UselessDefaultValueArgument: + Enabled: true +<% end %> + Lint/UselessDefined: Enabled: false @@ -462,6 +469,11 @@ Lint/UselessMethodDefinition: Lint/UselessNumericOperation: Enabled: false +<% if rubocop_version >= "1.76" %> +Lint/UselessOr: + Enabled: true +<% end %> + Lint/UselessRescue: Enabled: false @@ -558,7 +570,16 @@ Naming/MethodName: Naming/MethodParameterName: Enabled: false +<% if rubocop_version >= "1.76" %> +Naming/PredicateMethod: + Enabled: false +<% end %> + +<% if rubocop_version >= "1.76" %> +Naming/PredicatePrefix: +<% else %> Naming/PredicateName: +<% end %> Enabled: false NamePrefix: - is_ @@ -768,6 +789,11 @@ Style/EmptyLiteral: Style/EmptyMethod: Enabled: false +<% if rubocop_version >= "1.76" %> +Style/EmptyStringInsideInterpolation: + Enabled: false +<% end %> + Style/Encoding: Enabled: false @@ -1112,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 0a5972a3..e7b63f15 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: true + 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: true + VersionAdded: '1.76' Lint/UselessRescue: Description: Checks for useless `rescue`s. Enabled: false @@ -2309,8 +2321,16 @@ 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: false + 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 VersionAdded: '0.50' @@ -2943,6 +2963,15 @@ Style/EmptyMethod: SupportedStyles: - compact - expanded +Style/EmptyStringInsideInterpolation: + Description: Checks for empty strings being assigned inside string interpolation. + StyleGuide: "#empty-strings-in-interpolation" + Enabled: false + 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 +3360,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 +3939,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: true + Safe: false + VersionAdded: '1.76' Style/RedundantAssignment: Description: Checks for redundant assignment before returning. Enabled: false