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 =

Returns Maps checker names to their implementation classes.

Returns:

  • (Hash)

    Maps checker names to their implementation classes.

{
  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)



26
27
28
29
# File 'lib/rosett_ai/comply/runner.rb', line 26

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



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

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