Skip to content

Commit a8000bc

Browse files
committed
Drop Ruby 2.6 runtime support
Follow up rubocop#277 (comment). This PR drops Ruby 2.6 runtime support to prepare to support Prism.
1 parent 38e4648 commit a8000bc

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
os: [ubuntu]
32-
ruby: [2.6, 2.7, "3.0", 3.1, 3.2, 3.3, head]
32+
ruby: [2.7, "3.0", 3.1, 3.2, 3.3, head]
3333
coverage: [null]
3434
modern: [null]
3535
title: [null]
3636
include:
3737
- { os: windows, ruby: mingw }
38-
- { ruby: 2.6, os: ubuntu, coverage: true, title: "Coverage" }
38+
- { ruby: 2.7, os: ubuntu, coverage: true, title: "Coverage" }
3939
- { ruby: "3.0", os: ubuntu, modern: true, title: 'Specs "modern"' }
4040
- { ruby: jruby, os: ubuntu }
4141
# jruby disabled because of: https://github.com/jruby/jruby/issues/6416

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AllCops:
1717
- 'lib/rubocop/ast/node_pattern/lexer.rex.rb'
1818
- 'spec/rubocop/ast/node_pattern/parse_helper.rb'
1919
- 'spec/rubocop/ast/fixtures/*'
20-
TargetRubyVersion: 2.6
20+
TargetRubyVersion: 2.7
2121
SuggestExtensions: false
2222

2323
# It cannot be replaced with suggested methods defined by RuboCop AST itself.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#278](https://github.com/rubocop/rubocop-ast/pull/278): **(Compatibility)** Drop Ruby 2.6 runtime support. ([@koic][])

lib/rubocop/ast/node.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ def parent_module_name
326326
# what class or module is this method/constant/etc definition in?
327327
# returns nil if answer cannot be determined
328328
ancestors = each_ancestor(:class, :module, :sclass, :casgn, :block)
329-
result = ancestors.map do |ancestor|
329+
result = ancestors.filter_map do |ancestor|
330330
parent_module_name_part(ancestor) do |full_name|
331331
return nil unless full_name
332332

333333
full_name
334334
end
335-
end.compact.reverse.join('::')
335+
end.reverse.join('::')
336336
result.empty? ? 'Object' : result
337337
end
338338

rubocop-ast.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
77
s.name = 'rubocop-ast'
88
s.version = RuboCop::AST::Version::STRING
99
s.platform = Gem::Platform::RUBY
10-
s.required_ruby_version = '>= 2.6.0'
10+
s.required_ruby_version = '>= 2.7.0'
1111
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
1212
s.description = <<-DESCRIPTION
1313
RuboCop's Node and NodePattern classes.

0 commit comments

Comments
 (0)