Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Ruby 2.4 support #129

Merged
merged 1 commit into from Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .circleci/config.yml
Expand Up @@ -38,9 +38,6 @@ workflows:
build:
jobs:
- documentation-checks
- rake_default:
name: Ruby 2.4
image: circleci/ruby:2.4
- rake_default:
name: Ruby 2.5
image: circleci/ruby:2.5
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -9,7 +9,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
SuggestExtensions: false

InternalAffairs/NodeMatcherDirective:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Changes

* [#129](https://github.com/rubocop/rubocop-minitest/pull/129): Drop Ruby 2.4 support. ([@koic][])

## 0.11.1 (2021-03-31)

### Changes
Expand Down
2 changes: 1 addition & 1 deletion rubocop-minitest.gemspec
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
DESCRIPTION
spec.license = 'MIT'

spec.required_ruby_version = '>= 2.4.0'
spec.required_ruby_version = '>= 2.5.0'
spec.metadata = {
'homepage_uri' => 'https://docs.rubocop.org/rubocop-minitest/',
'changelog_uri' => 'https://github.com/rubocop/rubocop-minitest/blob/master/CHANGELOG.md',
Expand Down
20 changes: 9 additions & 11 deletions tasks/cops_documentation.rake
Expand Up @@ -46,17 +46,15 @@ task documentation_syntax_check: :yard_for_generate_documentation do
end

examples.to_a.each do |example|
begin
buffer = Parser::Source::Buffer.new('<code>', 1)
buffer.source = example.text
parser = Parser::Ruby25.new(RuboCop::AST::Builder.new)
parser.diagnostics.all_errors_are_fatal = true
parser.parse(buffer)
rescue Parser::SyntaxError => e
path = example.object.file
puts "#{path}: Syntax Error in an example. #{e}"
ok = false
end
buffer = Parser::Source::Buffer.new('<code>', 1)
buffer.source = example.text
parser = Parser::Ruby25.new(RuboCop::AST::Builder.new)
parser.diagnostics.all_errors_are_fatal = true
parser.parse(buffer)
rescue Parser::SyntaxError => e
path = example.object.file
puts "#{path}: Syntax Error in an example. #{e}"
ok = false
end
end
abort unless ok
Expand Down
4 changes: 2 additions & 2 deletions test/assertion_helper.rb
Expand Up @@ -8,7 +8,7 @@ module AssertionHelper
private

def setup
cop_name = self.class.to_s.sub(/Test\z/, '')
cop_name = self.class.to_s.delete_suffix('Test')

@cop = RuboCop::Cop::Minitest.const_get(cop_name).new
end
Expand Down Expand Up @@ -88,6 +88,6 @@ def parse_source!(source, file = nil)
end

def ruby_version
2.4
2.5
end
end