Skip to content

Commit bcf9868

Browse files
committed
Drop Ruby 2.6 support
Follow up rubocop/rubocop#11791. This PR drops Ruby 2.6 support. And JRuby has been dropped from the CI matrix because no JRuby-specific issues have been found and prevents the following build error: ```console #!/bin/bash -eo pipefail bundle install Fetching https://github.com/rubocop/rubocop.git You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git Exited with code exit status 11 CircleCI received exit code 11 ``` https://app.circleci.com/pipelines/github/rubocop/rubocop-minitest/926/workflows/68776b54-5856-4acd-a99a-f41df114634d/jobs/6034 This does not mean no support for JRuby. RuboCop Rails will continue to support JRuby 9.4+.
1 parent 2dd4b95 commit bcf9868

File tree

8 files changed

+11
-21
lines changed

8 files changed

+11
-21
lines changed

.circleci/config.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ workflows:
3535
build:
3636
jobs:
3737
- documentation-checks
38-
- rake_default:
39-
name: Ruby 2.6
40-
image: cimg/ruby:2.6
4138
- rake_default:
4239
name: Ruby 2.7
4340
image: cimg/ruby:2.7
@@ -53,6 +50,3 @@ workflows:
5350
- rake_default:
5451
name: Ruby HEAD
5552
image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
56-
- rake_default:
57-
name: JRuby 9.3
58-
image: circleci/jruby:9.3

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AllCops:
1313
- 'vendor/**/*'
1414
- 'spec/fixtures/**/*'
1515
- 'tmp/**/*'
16-
TargetRubyVersion: 2.6
16+
TargetRubyVersion: 2.7
1717
SuggestExtensions: false
1818

1919
InternalAffairs/NodeMatcherDirective:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#986](https://github.com/rubocop/rubocop-rails/pull/986): **(Breaking)** Drop Ruby 2.6 support. ([@koic][])

lib/rubocop/cop/rails/lexically_scoped_action_filter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ def array_values(node) # rubocop:disable Metrics/MethodLength
176176
when :sym
177177
[node.value]
178178
when :array
179-
node.values.map do |v|
179+
node.values.filter_map do |v|
180180
case v.type
181181
when :str
182182
v.str_content.to_sym
183183
when :sym
184184
v.value
185185
end
186-
end.compact
186+
end
187187
else
188188
[]
189189
end

lib/rubocop/rails/schema_loader/schema.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ def with_column?(name:)
8383
private
8484

8585
def build_columns(node)
86-
each_content(node).map do |child|
86+
each_content(node).filter_map do |child|
8787
next unless child&.send_type?
8888
next if child.method?(:index)
8989

9090
Column.new(child)
91-
end.compact
91+
end
9292
end
9393

9494
def build_indices(node)
95-
each_content(node).map do |child|
95+
each_content(node).filter_map do |child|
9696
next unless child&.send_type?
9797
next unless child.method?(:index)
9898

9999
Index.new(child)
100-
end.compact
100+
end
101101
end
102102

103103
def each_content(node, &block)

rubocop-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
88
s.name = 'rubocop-rails'
99
s.version = RuboCop::Rails::Version::STRING
1010
s.platform = Gem::Platform::RUBY
11-
s.required_ruby_version = '>= 2.6.0'
11+
s.required_ruby_version = '>= 2.7.0'
1212
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
1313
s.description = <<~DESCRIPTION
1414
Automatic Rails code style checking tool.

spec/project_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@
138138

139139
describe 'link to related issue' do
140140
let(:issues) do
141-
entries.map do |entry|
141+
entries.filter_map do |entry|
142142
entry.match(/\[(?<number>[#\d]+)\]\((?<url>[^)]+)\)/)
143-
end.compact
143+
end
144144
end
145145

146146
it 'has an issue number prefixed with #' do

tasks/changelog.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# frozen_string_literal: true
22

3-
if RUBY_VERSION < '2.6'
4-
puts 'Changelog utilities available only for Ruby 2.6+'
5-
exit(1)
6-
end
7-
83
# Changelog utility
94
class Changelog
105
ENTRIES_PATH = 'changelog/'

0 commit comments

Comments
 (0)