From 109bc4e0f39a2b3ce6f3413fd9823f4ddf0e3ecb Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Tue, 18 Apr 2023 11:14:21 +0900 Subject: [PATCH] Drop Ruby 2.6 support Follow up https://github.com/rubocop/rubocop/pull/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 Minitest will continue to support JRuby 9.4+. --- .circleci/config.yml | 6 ------ .rubocop.yml | 2 +- changelog/change_drop_ruby_2_6_support.md | 1 + lib/rubocop/minitest/assert_offense.rb | 2 +- rubocop-minitest.gemspec | 2 +- tasks/changelog.rb | 5 ----- test/project_test.rb | 4 ++-- 7 files changed, 6 insertions(+), 16 deletions(-) create mode 100644 changelog/change_drop_ruby_2_6_support.md diff --git a/.circleci/config.yml b/.circleci/config.yml index 659e0233..d0339eec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index b2faf057..7898aa57 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 SuggestExtensions: false InternalAffairs/NodeMatcherDirective: diff --git a/changelog/change_drop_ruby_2_6_support.md b/changelog/change_drop_ruby_2_6_support.md new file mode 100644 index 00000000..57710775 --- /dev/null +++ b/changelog/change_drop_ruby_2_6_support.md @@ -0,0 +1 @@ +* [#250](https://github.com/rubocop/rubocop-minitest/pull/250): **(Breaking)** Drop Ruby 2.6 support. ([@koic][]) diff --git a/lib/rubocop/minitest/assert_offense.rb b/lib/rubocop/minitest/assert_offense.rb index fd17cfc3..8bd5be60 100644 --- a/lib/rubocop/minitest/assert_offense.rb +++ b/lib/rubocop/minitest/assert_offense.rb @@ -216,7 +216,7 @@ def registry end def ruby_version - 2.6 + RuboCop::TargetRuby::DEFAULT_VERSION end end # rubocop:enable Metrics/ModuleLength diff --git a/rubocop-minitest.gemspec b/rubocop-minitest.gemspec index 4ccc014a..ba925cbd 100644 --- a/rubocop-minitest.gemspec +++ b/rubocop-minitest.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |spec| DESCRIPTION spec.license = 'MIT' - spec.required_ruby_version = '>= 2.6.0' + spec.required_ruby_version = '>= 2.7.0' spec.metadata = { 'homepage_uri' => 'https://docs.rubocop.org/rubocop-minitest/', 'changelog_uri' => 'https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md', diff --git a/tasks/changelog.rb b/tasks/changelog.rb index d27ee4d7..165c46fd 100644 --- a/tasks/changelog.rb +++ b/tasks/changelog.rb @@ -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/' diff --git a/test/project_test.rb b/test/project_test.rb index 2ea874d0..b3dca281 100644 --- a/test/project_test.rb +++ b/test/project_test.rb @@ -156,9 +156,9 @@ def load_feature_entries end def prepare_changelog_entries(entries) - @issues += entries.map do |entry| + @issues += entries.filter_map do |entry| entry.match(/\[(?[#\d]+)\]\((?[^)]+)\)/) - end.compact + end @bodies += entries.map do |entry| entry.gsub(/`[^`]+`/, '``').sub(/^\*\s*(?:\[.+?\):\s*)?/, '').sub(/\s*\([^)]+\)$/, '')