From 4b2748c3eb780be03aea2679098d38918e835dc7 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Fri, 25 Sep 2020 01:40:56 +0900 Subject: [PATCH 1/2] [Fix #8165] Require Parser gem 2.7.1.5 Parser 2.7.1.5 includes https://github.com/whitequark/parser/pull/717 and fixes #8165. --- rubocop.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubocop.gemspec b/rubocop.gemspec index e8abd630eaa..52a485506b1 100644 --- a/rubocop.gemspec +++ b/rubocop.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |s| } s.add_runtime_dependency('parallel', '~> 1.10') - s.add_runtime_dependency('parser', '>= 2.7.1.1') + s.add_runtime_dependency('parser', '>= 2.7.1.5') s.add_runtime_dependency('rainbow', '>= 2.2.2', '< 4.0') s.add_runtime_dependency('regexp_parser', '>= 1.7') s.add_runtime_dependency('rexml') From 69370a81496f775ad785b6887ee85708b9a1a47c Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Fri, 25 Sep 2020 01:58:56 +0900 Subject: [PATCH 2/2] Update Ruby 2.8 to Ruby 3.0 Follow https://github.com/whitequark/parser/pull/729. --- CHANGELOG.md | 4 ++++ docs/modules/ROOT/pages/compatibility.adoc | 2 +- lib/rubocop/target_ruby.rb | 2 +- rubocop.gemspec | 2 +- spec/rubocop/cli_spec.rb | 6 +++--- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 357dcc8674f..9f995caf35f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * [#8774](https://github.com/rubocop-hq/rubocop/issues/8774): Fix a false positive for `Layout/ArrayAlignment` with parallel assignment. ([@dvandersluis][]) +### Changes + +* [#8785](https://github.com/rubocop-hq/rubocop/pull/8785): Update TargetRubyVersion 2.8 to 3.0 (experimental). ([@em-gazelle][]) + ## 0.91.1 (2020-09-23) ### Bug fixes diff --git a/docs/modules/ROOT/pages/compatibility.adoc b/docs/modules/ROOT/pages/compatibility.adoc index 4aeb7c66af1..ea19baf0aa9 100644 --- a/docs/modules/ROOT/pages/compatibility.adoc +++ b/docs/modules/ROOT/pages/compatibility.adoc @@ -30,7 +30,7 @@ The following table is the support matrix. | 2.5 | - | 2.6 | - | 2.7 | - -| 2.8 (experimental) | - +| 3.0 (experimental) | - |=== NOTE: The compatibility xref:configuration.adoc#setting-the-target-ruby-version[target Ruby version mentioned here] is about code analysis (what RuboCop can analyze), not runtime (is RuboCop capable of running on some Ruby or not). diff --git a/lib/rubocop/target_ruby.rb b/lib/rubocop/target_ruby.rb index d9abb5b2e01..c1b02520d55 100644 --- a/lib/rubocop/target_ruby.rb +++ b/lib/rubocop/target_ruby.rb @@ -4,7 +4,7 @@ module RuboCop # The kind of Ruby that code inspected by RuboCop is written in. # @api private class TargetRuby - KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7, 2.8].freeze + KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7, 3.0].freeze DEFAULT_VERSION = KNOWN_RUBIES.first OBSOLETE_RUBIES = { diff --git a/rubocop.gemspec b/rubocop.gemspec index 52a485506b1..693b034133a 100644 --- a/rubocop.gemspec +++ b/rubocop.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency('rainbow', '>= 2.2.2', '< 4.0') s.add_runtime_dependency('regexp_parser', '>= 1.7') s.add_runtime_dependency('rexml') - s.add_runtime_dependency('rubocop-ast', '>= 0.4.0', '< 1.0') + s.add_runtime_dependency('rubocop-ast', '>= 0.5.0', '< 1.0') s.add_runtime_dependency('ruby-progressbar', '~> 1.7') s.add_runtime_dependency('unicode-display_width', '>= 1.4.0', '< 2.0') diff --git a/spec/rubocop/cli_spec.rb b/spec/rubocop/cli_spec.rb index 0ba9673d46c..baee491a030 100644 --- a/spec/rubocop/cli_spec.rb +++ b/spec/rubocop/cli_spec.rb @@ -1634,14 +1634,14 @@ def method(foo, bar, qux, fred, arg5, f) end #{'#' * 85} it 'fails with an error message' do create_file('.rubocop.yml', <<~YAML) AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 4.0 YAML expect(cli.run([])).to eq(2) expect($stderr.string.strip).to start_with( - 'Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion`' + 'Error: RuboCop found unknown Ruby version 4.0 in `TargetRubyVersion`' ) expect($stderr.string.strip).to match( - /Supported versions: 2.4, 2.5, 2.6, 2.7, 2.8/ + /Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0/ ) end end