Skip to content

Commit

Permalink
Update Ruby 2.8 to Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Sep 24, 2020
1 parent 4b2748c commit 69370a8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/compatibility.adoc
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/target_ruby.rb
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion rubocop.gemspec
Expand Up @@ -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')

Expand Down
6 changes: 3 additions & 3 deletions spec/rubocop/cli_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 69370a8

Please sign in to comment.