Skip to content

Commit

Permalink
Merge pull request #1453 from mbj/remove/ruby-3.0-support
Browse files Browse the repository at this point in the history
Remove Ruby 3.0 support
  • Loading branch information
mbj committed Jun 10, 2024
2 parents 0fea2e7 + 645bf2c commit e0f16de
Show file tree
Hide file tree
Showing 185 changed files with 737 additions and 749 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
include:
- os: macos-latest
ruby: ruby-3.2
- os: macos-latest
ruby: ruby-3.1
- os: macos-latest
ruby: ruby-3.0
execution:
- bundle exec rspec spec/unit
- bundle exec mutant environment test run spec/unit
Expand All @@ -43,15 +41,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
include:
- os: macos-latest
ruby: ruby-3.2
- os: macos-latest
ruby: ruby-3.1
- os: macos-latest
ruby: ruby-3.0
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -68,15 +64,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
include:
- os: macos-latest
ruby: ruby-3.2
- os: macos-latest
ruby: ruby-3.1
- os: macos-latest
ruby: ruby-3.0
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand All @@ -96,7 +90,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand All @@ -112,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand All @@ -128,7 +122,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand All @@ -144,7 +138,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ruby-3.0, ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
ruby: [ruby-3.1.2, ruby-3.1, ruby-3.2, ruby-3.3]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AllCops:
- 'tmp/**/*'
- 'vendor/**/*'
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1
# This is output on every run of `rubocop` and feels fairly noisy.
SuggestExtensions: false

Expand Down
10 changes: 9 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# v0.12.3 2024-06-10

* [#1452](https://github.com/mbj/mutant/pull/1451)

Remove support for EOL Ruby-3.0.
Remove another invalid mutation to super().


# v0.12.2 2024-06-09

+ [#1450](https://github.com/mbj/mutant/pull/1450)
* [#1450](https://github.com/mbj/mutant/pull/1450)

Remove invalid mutation operator.

Expand Down
32 changes: 17 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
PATH
remote: .
specs:
mutant (0.12.2)
mutant (0.12.3)
diff-lcs (~> 1.3)
parser (~> 3.3.0)
regexp_parser (~> 2.9.0)
sorbet-runtime (~> 0.5.0)
unparser (~> 0.6.9)
unparser (~> 0.6.14)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
diff-lcs (1.5.1)
json (2.7.1)
json (2.7.2)
language_server-protocol (3.17.0.3)
parallel (1.24.0)
parser (3.3.0.5)
parallel (1.25.1)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
racc (1.7.3)
racc (1.8.0)
rainbow (3.1.1)
regexp_parser (2.9.0)
rexml (3.2.6)
regexp_parser (2.9.2)
rexml (3.2.9)
strscan
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand All @@ -35,27 +36,28 @@ GEM
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.61.0)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.1)
parser (>= 3.3.0.4)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
sorbet-runtime (0.5.11284)
sorbet-runtime (0.5.11422)
strscan (3.1.0)
unicode-display_width (2.5.0)
unparser (0.6.13)
unparser (0.6.14)
diff-lcs (~> 1.3)
parser (>= 3.3.0)

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ Supported indicates if a specific Ruby version / Implementation is actively supp

| Implementation | Version | Runtime | Syntax | Mutations | Supported |
| -------------- | -------------- | ------- | ------------------ | ------------------ | ------------------ |
| cRUBY/MRI | 3.0 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| cRUBY/MRI | 3.1 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| cRUBY/MRI | 3.2 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| cRUBY/MRI | 3.3 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| jruby | TBD | :email: | :email: | :email: | :email: |
| mruby | TBD | :email: | :email: | :email: | :email: |
| cRUBY/MRI | < 3.0 | :no_entry: | :no_entry: | :no_entry: | :no_entry: |
| cRUBY/MRI | < 3.1 | :no_entry: | :no_entry: | :no_entry: | :no_entry: |


Labels:
Expand Down
16 changes: 8 additions & 8 deletions lib/mutant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,22 +291,22 @@ module Mutant
boot_segments = boot_events.map do |name, timestamp_start, timestamp_end|
Segment.new(
id: gen_id.call,
name: name,
name:,
parent_id: library_segment.id,
timestamp_end: timestamp_end,
timestamp_start: timestamp_start
timestamp_end:,
timestamp_start:
)
end

timer = Timer.new(process: Process)

recorder = Segment::Recorder.new(
gen_id: gen_id,
gen_id:,
root_id: (executable_segment || library_segment).id,
parent_id: library_segment.id,
recording_start: recording_start,
recording_start:,
segments: [*executable_segment, library_segment, *boot_segments],
timer: timer
timer:
)

WORLD = World.new(
Expand All @@ -325,13 +325,13 @@ module Mutant
pathname: Pathname,
process: Process,
random: Random,
recorder: recorder,
recorder:,
stderr: $stderr,
stdout: $stdout,
tempfile: Tempfile,
thread: Thread,
time: Time,
timer: timer
timer:
)

# Reopen class to initialize constant to avoid dep circle
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/ast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class View

def on_line(line)
line_map.fetch(line, EMPTY_HASH).map do |node, stack|
View.new(node: node, stack: stack)
View.new(node:, stack:)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/mutant/ast/named_children.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def children(*names)
# @param [Symbol] name
#
# @return [undefined]
def define_private_method(name, &block)
define_method(name, &block)
def define_private_method(name, &)
define_method(name, &)
private(name)
end

Expand Down
12 changes: 6 additions & 6 deletions lib/mutant/ast/pattern/lexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def initialize(string)
@line_index = 0
@line_start = 0
@next_position = 0
@source = Source.new(string: string)
@source = Source.new(string:)
@string = string
@tokens = []
end
Expand Down Expand Up @@ -77,13 +77,13 @@ def consume_char

advance_position

@tokens << token(type: type, start_position: start_position)
@tokens << token(type:, start_position:)
end

def token(type:, start_position:, value: nil)
Token.new(
type: type,
value: value,
type:,
value:,
location: Source::Location.new(
source: @source,
line_index: @line_index,
Expand All @@ -101,7 +101,7 @@ def consume_string
if valid_string?(token.value)
@tokens << token
else
@error = Error::InvalidToken.new(token: token)
@error = Error::InvalidToken.new(token:)
end
end

Expand All @@ -123,7 +123,7 @@ def build_string(start_position, string)
token(
type: :string,
value: string,
start_position: start_position
start_position:
)
end

Expand Down
18 changes: 9 additions & 9 deletions lib/mutant/ast/pattern/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def run
token = peek
error(
message: "Unexpected token: #{token.type}",
token: token
token:
)
end
end
Expand Down Expand Up @@ -74,15 +74,15 @@ def parse_node
end

Node.new(
attribute: attribute,
descendant: descendant,
attribute:,
descendant:,
type: structure.type
)
end

def parse_attribute(name)
Node::Attribute.new(
name: name,
name:,
value: parse_alternative(
group_start: method(:parse_attribute_group),
string: method(:parse_attribute_value)
Expand All @@ -96,14 +96,14 @@ def parse_alternative(alternatives)
alternatives.fetch(token.type) do
error(
message: "Expected one of: #{alternatives.keys.join(',')} but got: #{token.type}",
token: token
token:
)
end.call
end

def parse_descendant(name)
Node::Descendant.new(
name: name,
name:,
pattern: parse_node
)
end
Expand All @@ -120,7 +120,7 @@ def parse_attribute_group

expect(:group_end)

Node::Attribute::Value::Group.new(values: values)
Node::Attribute::Value::Group.new(values:)
end

def parse_attribute_value
Expand Down Expand Up @@ -153,7 +153,7 @@ def parse_node_type
type = token.value.to_sym

Structure::ALL.fetch(type) do
error(token: token, message: "Expected valid node type got: #{type}")
error(token:, message: "Expected valid node type got: #{type}")
end
end

Expand All @@ -169,7 +169,7 @@ def expect(type)
token
else
error(
token: token,
token:,
message: "Expected token type: #{type} but got: #{token.type}"
)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/ast/structure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def maybe_descendant(name)

def self.fixed(values)
values.each_with_index.map do |(klass, name), index|
klass.new(index: index, name: name)
klass.new(index:, name:)
end
end

Expand Down
Loading

0 comments on commit e0f16de

Please sign in to comment.