NAME

App::Workflow::Lint::Engine - Workflow loading, rule execution, and fixing

SYNOPSIS

use App::Workflow::Lint::Engine;

my $engine = App::Workflow::Lint::Engine->new;

my $wf  = $engine->load_workflow('workflow.yml');
my @diags = $engine->check_file('workflow.yml');

my ($fixed, $diags) = $engine->fix_file('workflow.yml');

DESCRIPTION

App::Workflow::Lint::Engine is responsible for loading workflow files, running linting rules, and applying automatic fixes where available.

It is used internally by App::Workflow::Lint and the workflow-lint CLI.

METHODS

new

my $engine = App::Workflow::Lint::Engine->new(%opts);

Creates a new engine instance.

load_workflow

my $wf = $engine->load_workflow($file);

Reads the YAML workflow file and returns the parsed data structure. Position information is stored internally but currently unused.

save_workflow

$engine->save_workflow($file, $wf);

Writes the modified workflow back to disk.

rules

my @rules = $engine->rules;

Returns the list of linting rule objects applied to workflows.

check_file

my @diagnostics = $engine->check_file($file);

Runs all linting rules against the workflow and returns diagnostics.

apply_fixes

$engine->apply_fixes($workflow, @diagnostics);

Executes fix callbacks for any diagnostics that provide them.

fix_file

my ($workflow, $diagnostics) = $engine->fix_file($file);

Loads the workflow, applies rules, executes fixes, and returns the modified workflow and diagnostics.

line_for_path

my $line = $engine->line_for_path($file, $path);

Returns the stored line number for a given YAML path. Currently always undef, retained for API compatibility.