Skip to content

Commit

Permalink
Drop Ruby 2.6 support
Browse files Browse the repository at this point in the history
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+.
  • Loading branch information
koic committed Apr 18, 2023
1 parent 2dd4b95 commit bcf9868
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 21 deletions.
6 changes: 0 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ workflows:
build:
jobs:
- documentation-checks
- rake_default:
name: Ruby 2.6
image: cimg/ruby:2.6
- rake_default:
name: Ruby 2.7
image: cimg/ruby:2.7
Expand All @@ -53,6 +50,3 @@ workflows:
- rake_default:
name: Ruby HEAD
image: rubocophq/circleci-ruby-snapshot:latest # Nightly snapshot build
- rake_default:
name: JRuby 9.3
image: circleci/jruby:9.3
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AllCops:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
TargetRubyVersion: 2.6
TargetRubyVersion: 2.7
SuggestExtensions: false

InternalAffairs/NodeMatcherDirective:
Expand Down
1 change: 1 addition & 0 deletions changelog/change_drop_ruby_2_6_support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#986](https://github.com/rubocop/rubocop-rails/pull/986): **(Breaking)** Drop Ruby 2.6 support. ([@koic][])
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rails/lexically_scoped_action_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ def array_values(node) # rubocop:disable Metrics/MethodLength
when :sym
[node.value]
when :array
node.values.map do |v|
node.values.filter_map do |v|
case v.type
when :str
v.str_content.to_sym
when :sym
v.value
end
end.compact
end
else
[]
end
Expand Down
8 changes: 4 additions & 4 deletions lib/rubocop/rails/schema_loader/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@ def with_column?(name:)
private

def build_columns(node)
each_content(node).map do |child|
each_content(node).filter_map do |child|
next unless child&.send_type?
next if child.method?(:index)

Column.new(child)
end.compact
end
end

def build_indices(node)
each_content(node).map do |child|
each_content(node).filter_map do |child|
next unless child&.send_type?
next unless child.method?(:index)

Index.new(child)
end.compact
end
end

def each_content(node, &block)
Expand Down
2 changes: 1 addition & 1 deletion rubocop-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.name = 'rubocop-rails'
s.version = RuboCop::Rails::Version::STRING
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.6.0'
s.required_ruby_version = '>= 2.7.0'
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
s.description = <<~DESCRIPTION
Automatic Rails code style checking tool.
Expand Down
4 changes: 2 additions & 2 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@

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

it 'has an issue number prefixed with #' do
Expand Down
5 changes: 0 additions & 5 deletions tasks/changelog.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# frozen_string_literal: true

if RUBY_VERSION < '2.6'
puts 'Changelog utilities available only for Ruby 2.6+'
exit(1)
end

# Changelog utility
class Changelog
ENTRIES_PATH = 'changelog/'
Expand Down

0 comments on commit bcf9868

Please sign in to comment.