diff --git a/Gemfile.lock b/Gemfile.lock index add21649..a3a65995 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM method_source (1.0.0) minitest (5.20.0) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc pry (0.14.1) @@ -29,14 +29,14 @@ GEM racc (1.7.1) rainbow (3.1.1) rake (13.1.0) - regexp_parser (2.8.1) + regexp_parser (2.8.2) rexml (3.2.6) - rubocop (1.56.4) + rubocop (1.57.1) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) diff --git a/rubocop.yml b/rubocop.yml index 4e1c6270..6ed54bea 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,3 +1,5 @@ +<% rubocop_version = Gem.loaded_specs.fetch("rubocop").version %> + inherit_mode: merge: - Exclude @@ -794,6 +796,11 @@ Style/SelectByRegexp: Style/SingleArgumentDig: Enabled: false +<% if rubocop_version >= Gem::Version.new('1.57') %> +Style/SingleLineDoEndBlock: + Enabled: true +<% end %> + Style/SlicingWithRange: Enabled: false diff --git a/test/fixtures/full_config.yml b/test/fixtures/full_config.yml index d51dec6f..b7ef7fca 100644 --- a/test/fixtures/full_config.yml +++ b/test/fixtures/full_config.yml @@ -1586,7 +1586,9 @@ Lint/RedundantRegexpQuantifiers: Lint/RedundantRequireStatement: Description: Checks for unnecessary `require` statement. Enabled: false + SafeAutoCorrect: false VersionAdded: '0.76' + VersionChanged: '1.57' Lint/RedundantSafeNavigation: Description: Checks for redundant safe navigation calls. Enabled: false @@ -2488,7 +2490,9 @@ Style/ClassEqualityComparison: for equality. StyleGuide: "#instance-of-vs-class-comparison" Enabled: false + SafeAutoCorrect: false VersionAdded: '0.93' + VersionChanged: '1.57' AllowedMethods: - "==" - equal? @@ -3722,7 +3726,9 @@ Style/RedundantFilterChain: methods chained to `select`/`filter`/`find_all` and change them to use predicate method instead. Enabled: true + SafeAutoCorrect: false VersionAdded: '1.52' + VersionChanged: '1.57' Style/RedundantFreeze: Description: Checks usages of Object#freeze on immutable objects. Enabled: true @@ -3935,6 +3941,10 @@ Style/SingleLineBlockParams: - inject: - acc - elem +Style/SingleLineDoEndBlock: + Description: Checks for single-line `do`...`end` blocks. + Enabled: true + VersionAdded: '1.57' Style/SingleLineMethods: Description: Avoid single-line methods. StyleGuide: "#no-single-line-methods"