Skip to content

Commit

Permalink
Drop Ruby 2.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
MarttiCheng committed Apr 25, 2022
1 parent 15c0274 commit a8c416a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Expand Up @@ -35,9 +35,6 @@ workflows:
build:
jobs:
- documentation-checks
- rake_default:
name: Ruby 2.5
image: cimg/ruby:2.5
- rake_default:
name: Ruby 2.6
image: cimg/ruby:2.6
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -12,7 +12,7 @@ AllCops:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
TargetRubyVersion: 2.5
TargetRubyVersion: 2.6
SuggestExtensions: false

InternalAffairs/NodeMatcherDirective:
Expand Down
1 change: 1 addition & 0 deletions changelog/change_drop_ruby_2_5_support.md
@@ -0,0 +1 @@
* [#287](https://github.com/rubocop/rubocop-performance/pull/287): **(Breaking)** Drop Ruby 2.5 support. ([@koic][])
4 changes: 2 additions & 2 deletions lib/rubocop/cop/mixin/regexp_metacharacter.rb
Expand Up @@ -54,9 +54,9 @@ def literal_at_end_with_dollar?(regex_str)

def drop_start_metacharacter(regexp_string)
if regexp_string.start_with?('\\A')
regexp_string[2..-1] # drop `\A` anchor
regexp_string[2..] # drop `\A` anchor
else
regexp_string[1..-1] # drop `^` anchor
regexp_string[1..] # drop `^` anchor
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/performance/case_when_splat.rb
Expand Up @@ -168,7 +168,7 @@ def non_splat?(condition)

def needs_reorder?(when_node)
following_branches =
when_node.parent.when_branches[(when_node.branch_index + 1)..-1]
when_node.parent.when_branches[(when_node.branch_index + 1)..]

following_branches.any? do |when_branch|
when_branch.conditions.any? do |condition|
Expand Down
2 changes: 1 addition & 1 deletion rubocop-performance.gemspec
Expand Up @@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.name = 'rubocop-performance'
s.version = RuboCop::Performance::Version::STRING
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.5.0'
s.required_ruby_version = '>= 2.6.0'
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
s.description = <<~DESCRIPTION
A collection of RuboCop cops to check for performance optimizations
Expand Down

0 comments on commit a8c416a

Please sign in to comment.