Class: RosettAi::Comply::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/comply/runner.rb

Overview

Orchestrates compliance checks across all registered checkers.

Supports selective execution via check type filters (--cra, --license, --headers) and aggregates results for the Reporter.

Author:

  • hugo

  • claude

Constant Summary collapse

CHECKER_MAP =
{
  cra: Checkers::CraChecker,
  license: Checkers::LicenseChecker,
  headers: Checkers::SpdxHeaderChecker
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(project_root:, checks: nil) ⇒ Runner

Returns a new instance of Runner.

Parameters:

  • project_root (Pathname)

    project root directory

  • checks (Array<Symbol>, nil) (defaults to: nil)

    specific check types to run (nil = all)



24
25
26
27
# File 'lib/rosett_ai/comply/runner.rb', line 24

def initialize(project_root:, checks: nil)
  @project_root = project_root
  @checks = checks
end

Instance Method Details

#runArray<Hash>

Runs all applicable compliance checks.

Returns:

  • (Array<Hash>)

    aggregated check results



32
33
34
35
36
37
# File 'lib/rosett_ai/comply/runner.rb', line 32

def run
  active_checkers.flat_map do |checker_class|
    checker = checker_class.new(project_root: @project_root)
    checker.check
  end
end