mutant 0.12.1 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mutant/ast/named_children.rb +2 -2
  3. data/lib/mutant/ast/pattern/lexer.rb +6 -6
  4. data/lib/mutant/ast/pattern/parser.rb +9 -9
  5. data/lib/mutant/ast/structure.rb +1 -1
  6. data/lib/mutant/ast.rb +1 -1
  7. data/lib/mutant/bootstrap.rb +12 -12
  8. data/lib/mutant/cli/command/environment/test.rb +2 -2
  9. data/lib/mutant/cli/command/environment.rb +8 -8
  10. data/lib/mutant/cli/command/util.rb +2 -2
  11. data/lib/mutant/cli/command.rb +8 -8
  12. data/lib/mutant/cli.rb +1 -1
  13. data/lib/mutant/config.rb +6 -7
  14. data/lib/mutant/env.rb +10 -10
  15. data/lib/mutant/expression/descendants.rb +1 -1
  16. data/lib/mutant/expression/method.rb +2 -2
  17. data/lib/mutant/expression/methods.rb +2 -2
  18. data/lib/mutant/expression/parser.rb +4 -5
  19. data/lib/mutant/expression/source.rb +3 -3
  20. data/lib/mutant/integration.rb +2 -2
  21. data/lib/mutant/isolation/fork.rb +4 -4
  22. data/lib/mutant/isolation/none.rb +2 -2
  23. data/lib/mutant/matcher/descendants.rb +1 -1
  24. data/lib/mutant/matcher/method/instance.rb +3 -3
  25. data/lib/mutant/matcher/method/metaclass.rb +2 -2
  26. data/lib/mutant/matcher/method/singleton.rb +1 -1
  27. data/lib/mutant/matcher/method.rb +5 -19
  28. data/lib/mutant/matcher/methods.rb +2 -2
  29. data/lib/mutant/matcher/namespace.rb +1 -1
  30. data/lib/mutant/matcher/scope.rb +1 -1
  31. data/lib/mutant/matcher.rb +1 -1
  32. data/lib/mutant/meta/example/verification.rb +1 -1
  33. data/lib/mutant/meta/example.rb +4 -4
  34. data/lib/mutant/meta.rb +1 -1
  35. data/lib/mutant/mutation/runner/sink.rb +3 -3
  36. data/lib/mutant/mutation/runner.rb +1 -1
  37. data/lib/mutant/mutation.rb +2 -2
  38. data/lib/mutant/mutator/node/block.rb +1 -1
  39. data/lib/mutant/mutator/node/break.rb +1 -1
  40. data/lib/mutant/mutator/node/index.rb +1 -1
  41. data/lib/mutant/mutator/node/kwbegin.rb +1 -1
  42. data/lib/mutant/mutator/node/named_value/access.rb +1 -1
  43. data/lib/mutant/mutator/node/next.rb +1 -1
  44. data/lib/mutant/mutator/node/send/conditional.rb +1 -1
  45. data/lib/mutant/mutator/node/send.rb +1 -1
  46. data/lib/mutant/mutator/node/super.rb +0 -1
  47. data/lib/mutant/mutator/node/yield.rb +1 -1
  48. data/lib/mutant/mutator/node/zsuper.rb +0 -1
  49. data/lib/mutant/mutator/node.rb +5 -5
  50. data/lib/mutant/mutator/regexp.rb +2 -2
  51. data/lib/mutant/parallel/connection.rb +2 -2
  52. data/lib/mutant/parallel/pipe.rb +2 -2
  53. data/lib/mutant/parallel/worker.rb +10 -10
  54. data/lib/mutant/parallel.rb +3 -3
  55. data/lib/mutant/parser.rb +1 -1
  56. data/lib/mutant/registry.rb +1 -1
  57. data/lib/mutant/reporter/cli/format.rb +1 -1
  58. data/lib/mutant/reporter/cli/printer/isolation_result.rb +2 -2
  59. data/lib/mutant/reporter/cli/printer/status_progressive.rb +1 -1
  60. data/lib/mutant/reporter/cli/printer/test.rb +1 -1
  61. data/lib/mutant/reporter/cli/printer.rb +1 -1
  62. data/lib/mutant/reporter/cli.rb +3 -3
  63. data/lib/mutant/repository/diff.rb +6 -5
  64. data/lib/mutant/segment/recorder.rb +8 -8
  65. data/lib/mutant/subject/config.rb +1 -1
  66. data/lib/mutant/subject/method/instance.rb +1 -1
  67. data/lib/mutant/subject.rb +1 -1
  68. data/lib/mutant/test/runner/sink.rb +1 -1
  69. data/lib/mutant/test/runner.rb +1 -1
  70. data/lib/mutant/timer.rb +2 -2
  71. data/lib/mutant/transform.rb +20 -20
  72. data/lib/mutant/variable.rb +2 -2
  73. data/lib/mutant/version.rb +1 -1
  74. data/lib/mutant/world.rb +7 -7
  75. data/lib/mutant.rb +8 -8
  76. metadata +7 -6
@@ -25,7 +25,7 @@ module Mutant
25
25
  #
26
26
  # @return [Enumerable<Subject>]
27
27
  def call(env)
28
- evaluator.call(scope: scope, target_method: target_method, env: env)
28
+ evaluator.call(scope:, target_method:, env:)
29
29
  end
30
30
 
31
31
  # Abstract method match evaluator
@@ -76,9 +76,9 @@ module Mutant
76
76
  def subject
77
77
  self.class::SUBJECT_CLASS.new(
78
78
  config: subject_config(matched_view.node),
79
- context: context,
79
+ context:,
80
80
  node: matched_view.node,
81
- visibility: visibility
81
+ visibility:
82
82
  )
83
83
  end
84
84
 
@@ -87,7 +87,7 @@ module Mutant
87
87
  end
88
88
 
89
89
  def context
90
- Context.new(constant_scope: constant_scope, scope: scope, source_path: source_path)
90
+ Context.new(constant_scope:, scope:, source_path:)
91
91
  end
92
92
 
93
93
  # rubocop:disable Metrics/MethodLength
@@ -101,7 +101,7 @@ module Mutant
101
101
  if klass
102
102
  klass.new(
103
103
  const: node.children.fetch(0),
104
- descendant: descendant
104
+ descendant:
105
105
  )
106
106
  else
107
107
  descendant
@@ -163,20 +163,6 @@ module Mutant
163
163
  end
164
164
 
165
165
  def visibility
166
- # This can be cleaned up once we are on >ruby-3.0
167
- # Method#{public,private,protected}? exists there.
168
- #
169
- # On Ruby 3.1 this can just be:
170
- #
171
- # if target_method.private?
172
- # :private
173
- # elsif target_method.protected?
174
- # :protected
175
- # else
176
- # :public
177
- # end
178
- #
179
- # Change to this once 3.0 is EOL.
180
166
  if scope.raw.private_methods.include?(method_name)
181
167
  :private
182
168
  elsif scope.raw.protected_methods.include?(method_name)
@@ -22,7 +22,7 @@ module Mutant
22
22
  def call(env)
23
23
  Chain.new(
24
24
  matchers: methods(env).map do |target_method|
25
- matcher.new(scope: scope, target_method: target_method)
25
+ matcher.new(scope:, target_method:)
26
26
  end
27
27
  ).call(env)
28
28
  end
@@ -110,7 +110,7 @@ module Mutant
110
110
  candidate_scope.instance_method(method_name)
111
111
  rescue Exception => exception
112
112
  env.warn(
113
- MESSAGE % { scope: scope, method_name: method_name, exception: exception.inspect }
113
+ MESSAGE % { scope:, method_name:, exception: exception.inspect }
114
114
  )
115
115
  nil
116
116
  end
@@ -13,7 +13,7 @@ module Mutant
13
13
  # @return [Enumerable<Subject>]
14
14
  def call(env)
15
15
  Chain.new(
16
- matchers: matched_scopes(env).map { |scope| Scope.new(scope: scope) }
16
+ matchers: matched_scopes(env).map { |scope| Scope.new(scope:) }
17
17
  ).call(env)
18
18
  end
19
19
 
@@ -31,7 +31,7 @@ module Mutant
31
31
  private
32
32
 
33
33
  def effective_matchers
34
- MATCHERS.map { |matcher| matcher.new(scope: scope) }
34
+ MATCHERS.map { |matcher| matcher.new(scope:) }
35
35
  end
36
36
 
37
37
  end # Scope
@@ -22,7 +22,7 @@ module Mutant
22
22
  matcher_config = env.config.matcher
23
23
 
24
24
  Filter.new(
25
- matcher: Chain.new(matchers: matcher_config.subjects.map { |subject| subject.matcher(env: env) }),
25
+ matcher: Chain.new(matchers: matcher_config.subjects.map { |subject| subject.matcher(env:) }),
26
26
  predicate: method(:allowed_subject?).curry.call(matcher_config)
27
27
  )
28
28
  end
@@ -94,7 +94,7 @@ module Mutant
94
94
 
95
95
  def missing
96
96
  (example.expected.map(&:node) - mutations.map(&:node)).map do |node|
97
- Mutation::Evil.new(subject: example, node: node)
97
+ Mutation::Evil.new(subject: example, node:)
98
98
  end
99
99
  end
100
100
  memoize :missing
@@ -40,7 +40,7 @@ module Mutant
40
40
  def context
41
41
  Context.new(
42
42
  constant_scope: Context::ConstantScope::None.new,
43
- scope: scope,
43
+ scope:,
44
44
  source_path: location.path
45
45
  )
46
46
  end
@@ -58,10 +58,10 @@ module Mutant
58
58
  # @return [Enumerable<Mutant::Mutation>]
59
59
  def generated
60
60
  Mutator::Node.mutate(
61
- config: Mutation::Config::DEFAULT.with(operators: operators),
62
- node: node
61
+ config: Mutation::Config::DEFAULT.with(operators:),
62
+ node:
63
63
  ).map do |node|
64
- Mutation::Evil.new(subject: self, node: node)
64
+ Mutation::Evil.new(subject: self, node:)
65
65
  end
66
66
  end
67
67
  memoize :generated
data/lib/mutant/meta.rb CHANGED
@@ -18,7 +18,7 @@ module Mutant
18
18
  # @return [undefined]
19
19
  def self.add(*types, operators: :full, &block)
20
20
  ALL << DSL.call(
21
- block: block,
21
+ block:,
22
22
  location: caller_locations(1).first,
23
23
  operators: Mutation::Operators.parse(operators.to_s).from_right,
24
24
  types: Set.new(types)
@@ -22,7 +22,7 @@ module Mutant
22
22
  # @return [Result::Env]
23
23
  def status
24
24
  Result::Env.new(
25
- env: env,
25
+ env:,
26
26
  runtime: env.world.timer.now - @start,
27
27
  subject_results: @subject_results.values
28
28
  )
@@ -48,7 +48,7 @@ module Mutant
48
48
  subject = mutation_result.mutation.subject
49
49
 
50
50
  @subject_results[subject] = Result::Subject.new(
51
- subject: subject,
51
+ subject:,
52
52
  coverage_results: previous_coverage_results(subject).dup << coverage_result(mutation_result),
53
53
  tests: env.selections.fetch(subject)
54
54
  )
@@ -60,7 +60,7 @@ module Mutant
60
60
 
61
61
  def coverage_result(mutation_result)
62
62
  Result::Coverage.new(
63
- mutation_result: mutation_result,
63
+ mutation_result:,
64
64
  criteria_result: mutation_result.criteria_result(env.config.coverage_criteria)
65
65
  )
66
66
  end
@@ -45,7 +45,7 @@ module Mutant
45
45
  jobs: env.config.jobs,
46
46
  on_process_start: env.method(:emit_mutation_worker_process_start),
47
47
  process_name: 'mutant-worker-process',
48
- sink: Sink.new(env: env),
48
+ sink: Sink.new(env:),
49
49
  source: Parallel::Source::Array.new(jobs: env.mutations.each_index.to_a),
50
50
  timeout: nil,
51
51
  thread_name: 'mutant-worker-thread'
@@ -66,9 +66,9 @@ module Mutant
66
66
  subject.prepare
67
67
  Loader.call(
68
68
  binding: TOPLEVEL_BINDING,
69
- kernel: kernel,
69
+ kernel:,
70
70
  source: monkeypatch,
71
- subject: subject
71
+ subject:
72
72
  ).fmap do
73
73
  subject.post_insert
74
74
  nil
@@ -56,7 +56,7 @@ module Mutant
56
56
  def valid_send_mutation?(node)
57
57
  return false unless n_send?(node)
58
58
 
59
- last = AST::Meta::Send.new(node: node).arguments.last
59
+ last = AST::Meta::Send.new(node:).arguments.last
60
60
 
61
61
  !last&.type.equal?(:block_pass)
62
62
  end
@@ -12,7 +12,7 @@ module Mutant
12
12
  private
13
13
 
14
14
  def dispatch
15
- super()
15
+ super
16
16
  emit_singletons
17
17
  children.each_index(&method(:delete_child))
18
18
  end
@@ -76,7 +76,7 @@ module Mutant
76
76
  private
77
77
 
78
78
  def dispatch
79
- super()
79
+ super
80
80
 
81
81
  return if left_op_assignment?
82
82
 
@@ -12,7 +12,7 @@ module Mutant
12
12
  private
13
13
 
14
14
  def dispatch
15
- super()
15
+ super
16
16
  emit_singletons
17
17
  end
18
18
 
@@ -28,7 +28,7 @@ module Mutant
28
28
 
29
29
  def dispatch
30
30
  emit_attribute_read
31
- super()
31
+ super
32
32
  end
33
33
 
34
34
  def emit_attribute_read
@@ -12,7 +12,7 @@ module Mutant
12
12
  private
13
13
 
14
14
  def dispatch
15
- super()
15
+ super
16
16
  emit_singletons
17
17
  children.each_index(&method(:delete_child))
18
18
  emit(s(:break, *children))
@@ -11,7 +11,7 @@ module Mutant
11
11
  private
12
12
 
13
13
  def dispatch
14
- super()
14
+ super
15
15
  emit(s(:send, *children))
16
16
  end
17
17
 
@@ -48,7 +48,7 @@ module Mutant
48
48
  end
49
49
 
50
50
  def meta
51
- AST::Meta::Send.new(node: node)
51
+ AST::Meta::Send.new(node:)
52
52
  end
53
53
  memoize :meta
54
54
 
@@ -13,7 +13,6 @@ module Mutant
13
13
 
14
14
  def dispatch
15
15
  emit_singletons
16
- emit(N_EMPTY_SUPER)
17
16
  children.each_index do |index|
18
17
  mutate_child(index)
19
18
  delete_child(index)
@@ -12,7 +12,7 @@ module Mutant
12
12
  private
13
13
 
14
14
  def dispatch
15
- super()
15
+ super
16
16
  emit_singletons
17
17
  children.each_index(&method(:delete_child))
18
18
  end
@@ -13,7 +13,6 @@ module Mutant
13
13
 
14
14
  def dispatch
15
15
  emit_singletons
16
- emit(N_EMPTY_SUPER)
17
16
  end
18
17
 
19
18
  end # ZSuper
@@ -28,9 +28,9 @@ module Mutant
28
28
  end
29
29
 
30
30
  self::REGISTRY.lookup(node.type).call(
31
- config: config,
31
+ config:,
32
32
  input: node,
33
- parent: parent
33
+ parent:
34
34
  )
35
35
  end
36
36
 
@@ -67,7 +67,7 @@ module Mutant
67
67
  alias_method :dup_node, :dup_input
68
68
 
69
69
  def mutate(node:, parent: nil)
70
- self.class.mutate(config: config, node: node, parent: parent)
70
+ self.class.mutate(config:, node:, parent:)
71
71
  end
72
72
 
73
73
  def mutate_child(index, &block)
@@ -131,8 +131,8 @@ module Mutant
131
131
 
132
132
  def run(mutator)
133
133
  mutator.call(
134
- config: config,
135
- input: input,
134
+ config:,
135
+ input:,
136
136
  parent: nil
137
137
  ).each(&method(:emit))
138
138
  end
@@ -59,7 +59,7 @@ module Mutant
59
59
 
60
60
  def emit_expression(klass:, text:)
61
61
  emit(
62
- klass.construct(text: text).tap do |new|
62
+ klass.construct(text:).tap do |new|
63
63
  subexpressions.each do |expression|
64
64
  new << Marshal.load(Marshal.dump(expression))
65
65
  end
@@ -140,7 +140,7 @@ module Mutant
140
140
  def dispatch
141
141
  klass, text = MAP.fetch(input.class)
142
142
 
143
- emit(klass.construct(text: text).tap { |new| new.quantifier = input.quantifier })
143
+ emit(klass.construct(text:).tap { |new| new.quantifier = input.quantifier })
144
144
  end
145
145
  end
146
146
 
@@ -46,7 +46,7 @@ module Mutant
46
46
 
47
47
  Response.new(
48
48
  error: reader.error,
49
- job: job,
49
+ job:,
50
50
  log: reader.log,
51
51
  result: reader.result
52
52
  )
@@ -168,7 +168,7 @@ module Mutant
168
168
 
169
169
  def self.from_pipes(marshal:, reader:, writer:)
170
170
  new(
171
- marshal: marshal,
171
+ marshal:,
172
172
  reader: Frame.new(io: reader.to_reader),
173
173
  writer: Frame.new(io: writer.to_writer)
174
174
  )
@@ -10,13 +10,13 @@ module Mutant
10
10
  # @return [undefined]
11
11
  def self.with(io)
12
12
  io.pipe(binmode: true) do |(reader, writer)|
13
- yield new(reader: reader, writer: writer)
13
+ yield new(reader:, writer:)
14
14
  end
15
15
  end
16
16
 
17
17
  def self.from_io(io)
18
18
  reader, writer = io.pipe(binmode: true)
19
- new(reader: reader, writer: writer)
19
+ new(reader:, writer:)
20
20
  end
21
21
 
22
22
  # Writer end of the pipe
@@ -41,20 +41,20 @@ module Mutant
41
41
  world.stdout.reopen(log_writer)
42
42
 
43
43
  run_child(
44
- config: config,
45
- connection: Connection.from_pipes(marshal: marshal, reader: request, writer: response),
46
- log_writer: log_writer
44
+ config:,
45
+ connection: Connection.from_pipes(marshal:, reader: request, writer: response),
46
+ log_writer:
47
47
  )
48
48
  end
49
49
 
50
- connection = Connection.from_pipes(marshal: marshal, reader: response, writer: request)
50
+ connection = Connection.from_pipes(marshal:, reader: response, writer: request)
51
51
 
52
52
  new(
53
- config: config,
54
- connection: connection,
53
+ config:,
54
+ connection:,
55
55
  log_reader: log.to_reader,
56
56
  response_reader: connection.reader.io,
57
- pid: pid
57
+ pid:
58
58
  )
59
59
  end
60
60
  private_class_method :start_config
@@ -98,10 +98,10 @@ module Mutant
98
98
  response = Connection::Reader.read_response(
99
99
  deadline: config.world.deadline(config.timeout),
100
100
  io: config.world.io,
101
- job: job,
102
- log_reader: log_reader,
101
+ job:,
102
+ log_reader:,
103
103
  marshal: config.world.marshal,
104
- response_reader: response_reader
104
+ response_reader:
105
105
  )
106
106
 
107
107
  job_done(job)
@@ -17,7 +17,7 @@ module Mutant
17
17
  workers = workers(world, config, shared)
18
18
 
19
19
  Driver.new(
20
- workers: workers,
20
+ workers:,
21
21
  threads: threads(world, config, workers),
22
22
  **shared
23
23
  )
@@ -28,11 +28,11 @@ module Mutant
28
28
  Array.new(config.jobs) do |index|
29
29
  Worker.start(
30
30
  block: config.block,
31
- index: index,
31
+ index:,
32
32
  on_process_start: config.on_process_start,
33
33
  process_name: "#{config.process_name}-#{index}",
34
34
  timeout: config.timeout,
35
- world: world,
35
+ world:,
36
36
  **shared
37
37
  )
38
38
  end
data/lib/mutant/parser.rb CHANGED
@@ -27,7 +27,7 @@ module Mutant
27
27
  node, comments = Unparser.parse_with_comments(source)
28
28
 
29
29
  AST.new(
30
- node: node,
30
+ node:,
31
31
  comment_associations: ::Parser::Source::Comment.associate_by_identity(node, comments)
32
32
  )
33
33
  end
@@ -9,7 +9,7 @@ module Mutant
9
9
  #
10
10
  # @return [undefined]
11
11
  def initialize(default)
12
- super(contents: {}, default: default)
12
+ super(contents: {}, default:)
13
13
  end
14
14
 
15
15
  # Raised when the type is an invalid type
@@ -54,7 +54,7 @@ module Mutant
54
54
 
55
55
  def format(printer, object)
56
56
  buffer = new_buffer
57
- printer.call(output: Output.new(tty: tty, buffer: buffer), object: object)
57
+ printer.call(output: Output.new(tty:, buffer:), object:)
58
58
  buffer.rewind
59
59
  buffer.read
60
60
  end
@@ -58,7 +58,7 @@ module Mutant
58
58
  puts('Log messages (combined stderr and stdout):')
59
59
 
60
60
  log.each_line do |line|
61
- puts('[killfork] %<line>s' % { line: line })
61
+ puts('[killfork] %<line>s' % { line: })
62
62
  end
63
63
  end
64
64
 
@@ -74,7 +74,7 @@ module Mutant
74
74
 
75
75
  def print_timeout
76
76
  timeout = object.timeout or return
77
- puts(TIMEOUT_ERROR_MESSAGE % { timeout: timeout })
77
+ puts(TIMEOUT_ERROR_MESSAGE % { timeout: })
78
78
  end
79
79
 
80
80
  def print_exception
@@ -35,7 +35,7 @@ module Mutant
35
35
  private
36
36
 
37
37
  def object
38
- super().payload
38
+ super.payload
39
39
  end
40
40
 
41
41
  def mutations_per_second
@@ -145,7 +145,7 @@ module Mutant
145
145
  private
146
146
 
147
147
  def object
148
- super().payload
148
+ super.payload
149
149
  end
150
150
 
151
151
  def tests_per_second
@@ -61,7 +61,7 @@ module Mutant
61
61
  end
62
62
 
63
63
  def visit(printer, object)
64
- printer.call(output: output, object: object)
64
+ printer.call(output:, object:)
65
65
  end
66
66
 
67
67
  def info(string, *arguments)
@@ -15,7 +15,7 @@ module Mutant
15
15
  new(
16
16
  format: Format::Progressive.new(tty: output.respond_to?(:tty?) && output.tty?),
17
17
  print_warnings: false,
18
- output: output
18
+ output:
19
19
  )
20
20
  end
21
21
 
@@ -80,7 +80,7 @@ module Mutant
80
80
  #
81
81
  # @return [self]
82
82
  def report(env)
83
- Printer::EnvResult.call(output: output, object: env)
83
+ Printer::EnvResult.call(output:, object: env)
84
84
  self
85
85
  end
86
86
 
@@ -90,7 +90,7 @@ module Mutant
90
90
  #
91
91
  # @return [self]
92
92
  def test_report(env)
93
- Printer::Test::EnvResult.call(output: output, object: env)
93
+ Printer::Test::EnvResult.call(output:, object: env)
94
94
  self
95
95
  end
96
96
 
@@ -40,8 +40,8 @@ module Mutant
40
40
  .fmap { |status| world.pathname.new(status.stdout.chomp) }
41
41
  end
42
42
 
43
- def touched_path(path, &block)
44
- touched_paths.from_right { |message| fail Error, message }.fetch(path, &block)
43
+ def touched_path(path, &)
44
+ touched_paths.from_right { |message| fail Error, message }.fetch(path, &)
45
45
  end
46
46
 
47
47
  def touched_paths
@@ -62,15 +62,16 @@ module Mutant
62
62
  end
63
63
 
64
64
  # rubocop:disable Metrics/MethodLength
65
+ # mutant:disable (3.2 specific mutation)
65
66
  def parse_line(root, line)
66
67
  match = FORMAT.match(line)
67
68
 
68
69
  if match
69
70
  Either::Right.new(
70
71
  Path.new(
71
- path: root.join(match.captures.first),
72
- to: to,
73
- world: world
72
+ path: root.join(Util.one(match.captures)),
73
+ to:,
74
+ world:
74
75
  )
75
76
  )
76
77
  else
@@ -23,9 +23,9 @@ module Mutant
23
23
 
24
24
  yield.tap do
25
25
  segments << Segment.new(
26
- id: id,
27
- name: name,
28
- parent_id: parent_id,
26
+ id:,
27
+ name:,
28
+ parent_id:,
29
29
  timestamp_end: timer.now,
30
30
  timestamp_start: start
31
31
  )
@@ -58,7 +58,7 @@ module Mutant
58
58
 
59
59
  build_node(
60
60
  value: id_index.fetch(root_id),
61
- parent_index: parent_index
61
+ parent_index:
62
62
  )
63
63
  end
64
64
 
@@ -69,17 +69,17 @@ module Mutant
69
69
  if segment.timestamp_end
70
70
  segment
71
71
  else
72
- segment.with(timestamp_end: timestamp_end)
72
+ segment.with(timestamp_end:)
73
73
  end
74
74
  end
75
75
  end
76
76
 
77
77
  def build_node(value:, parent_index:)
78
78
  Node.new(
79
- value: value,
79
+ value:,
80
80
  children: build_children(
81
81
  parent_id: value.id,
82
- parent_index: parent_index
82
+ parent_index:
83
83
  )
84
84
  )
85
85
  end
@@ -87,7 +87,7 @@ module Mutant
87
87
  def build_children(parent_id:, parent_index:)
88
88
  parent_index
89
89
  .fetch(parent_id, EMPTY_ARRAY)
90
- .map { |value| build_node(value: value, parent_index: parent_index) }
90
+ .map { |value| build_node(value:, parent_index:) }
91
91
  end
92
92
 
93
93
  def print_node(io, node, indent)
@@ -13,7 +13,7 @@ module Mutant
13
13
  def self.parse(comments:, mutation:)
14
14
  new(
15
15
  inline_disable: comments.any? { |comment| DISABLE_REGEXP.match?(comment_body(comment)) },
16
- mutation: mutation
16
+ mutation:
17
17
  )
18
18
  end
19
19