From b26618e9662881c2a11ad6c58c48cf057bdbd38e Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Tue, 12 Nov 2024 16:42:49 +0000 Subject: [PATCH] Add experimental run_ml subcommand --- lib/mutant/cli/command/environment/run.rb | 11 +++++++++++ lib/mutant/cli/command/root.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/mutant/cli/command/environment/run.rb b/lib/mutant/cli/command/environment/run.rb index 3db61a740..ee66674bc 100644 --- a/lib/mutant/cli/command/environment/run.rb +++ b/lib/mutant/cli/command/environment/run.rb @@ -54,6 +54,17 @@ def verify_usage(environment) environment.config.usage.verify.fmap { environment } end end # Run + + class RunML < Run + NAME = 'run_ml' + SHORT_DESCRIPTION = 'Run code analysis with ML integration' + + def from_result(result) + super(result) + + # overwrite this method with a monkeypatch and do your own stuff with `result` now. + end + end end # Environment end # Command end # CLI diff --git a/lib/mutant/cli/command/root.rb b/lib/mutant/cli/command/root.rb index 8888a3be4..991544950 100644 --- a/lib/mutant/cli/command/root.rb +++ b/lib/mutant/cli/command/root.rb @@ -10,7 +10,7 @@ class Environment < self class Root < self NAME = 'mutant' SHORT_DESCRIPTION = 'mutation testing engine main command' - SUBCOMMANDS = [Environment::Run, Environment, Util].freeze + SUBCOMMANDS = [Environment::Run, Environment::RunML, Environment, Util].freeze end # Root end # Command end # CLI