Class: Ace::Lint::Organisms::LintOrchestrator
- Inherits:
-
Object
- Object
- Ace::Lint::Organisms::LintOrchestrator
- Defined in:
- lib/ace/lint/organisms/lint_orchestrator.rb
Overview
Orchestrates linting of multiple files Supports group-based validator configuration for Ruby files
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#any_failures? ⇒ Boolean
Check if any file failed.
-
#failed_count ⇒ Integer
Get count of failed files.
-
#initialize(ruby_groups: nil) ⇒ LintOrchestrator
constructor
Initialize orchestrator.
-
#lint_files(file_paths, options: {}) ⇒ Array<Models::LintResult>
Lint multiple files.
-
#passed_count ⇒ Integer
Get count of passed files.
-
#total_errors ⇒ Integer
Get total error count across all files.
-
#total_warnings ⇒ Integer
Get total warning count across all files.
Constructor Details
#initialize(ruby_groups: nil) ⇒ LintOrchestrator
Initialize orchestrator
24 25 26 27 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 24 def initialize(ruby_groups: nil) @results = [] @group_resolver = ruby_groups ? Molecules::GroupResolver.new(ruby_groups) : nil end |
Instance Attribute Details
#results ⇒ Object (readonly)
Returns the value of attribute results.
20 21 22 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 20 def results @results end |
Instance Method Details
#any_failures? ⇒ Boolean
Check if any file failed
64 65 66 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 64 def any_failures? @results.any?(&:failed?) end |
#failed_count ⇒ Integer
Get count of failed files
76 77 78 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 76 def failed_count @results.count(&:failed?) end |
#lint_files(file_paths, options: {}) ⇒ Array<Models::LintResult>
Lint multiple files
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 38 def lint_files(file_paths, options: {}) # Group files by type for batch processing files_by_type = group_files_by_type(file_paths, options: ) # Batch process Ruby files (performance optimization) @results = [] # Process non-Ruby files individually non_ruby_files = files_by_type.except(:ruby) non_ruby_files.each do |type, paths| paths.each do |file_path| @results << lint_single_file_by_type(file_path, type, options: ) end end # Batch process Ruby files (with group-aware routing) if files_by_type[:ruby]&.any? ruby_results = batch_lint_ruby(files_by_type[:ruby], options: ) @results.concat(ruby_results) end @results end |
#passed_count ⇒ Integer
Get count of passed files
70 71 72 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 70 def passed_count @results.count(&:success) end |
#total_errors ⇒ Integer
Get total error count across all files
82 83 84 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 82 def total_errors @results.sum(&:error_count) end |
#total_warnings ⇒ Integer
Get total warning count across all files
88 89 90 |
# File 'lib/ace/lint/organisms/lint_orchestrator.rb', line 88 def total_warnings @results.sum(&:warning_count) end |