Module: CleoQualityReview
- Defined in:
- lib/cleo_quality_review.rb,
lib/cleo_quality_review/cli.rb,
lib/cleo_quality_review/run.rb,
lib/cleo_quality_review/checks.rb,
lib/cleo_quality_review/result.rb,
lib/cleo_quality_review/runner.rb,
lib/cleo_quality_review/options.rb,
lib/cleo_quality_review/version.rb,
lib/cleo_quality_review/diff_map.rb,
lib/cleo_quality_review/formatter.rb,
lib/cleo_quality_review/llm_client.rb,
lib/cleo_quality_review/llm_config.rb,
lib/cleo_quality_review/llm_errors.rb,
lib/cleo_quality_review/llm_logger.rb,
lib/cleo_quality_review/checks/flog.rb,
lib/cleo_quality_review/checks/reek.rb,
lib/cleo_quality_review/changes_diff.rb,
lib/cleo_quality_review/configuration.rb,
lib/cleo_quality_review/git_diff_base.rb,
lib/cleo_quality_review/llm_providers.rb,
lib/cleo_quality_review/prompt_loader.rb,
lib/cleo_quality_review/run_artifacts.rb,
lib/cleo_quality_review/checks/debride.rb,
lib/cleo_quality_review/command_result.rb,
lib/cleo_quality_review/command_runner.rb,
lib/cleo_quality_review/prompt_builder.rb,
lib/cleo_quality_review/checks/fasterer.rb,
lib/cleo_quality_review/checks/registry.rb,
lib/cleo_quality_review/target_resolver.rb,
lib/cleo_quality_review/llm_providers/stub.rb,
lib/cleo_quality_review/checks/quality_check.rb,
lib/cleo_quality_review/github_review_builder.rb,
lib/cleo_quality_review/llm_providers/open_ai.rb,
lib/cleo_quality_review/llm_providers/registry.rb,
lib/cleo_quality_review/github_review_publisher.rb,
lib/cleo_quality_review/llm_providers/open_ai_config.rb,
lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb
Overview
Quality review tool for Ruby code analysis
Defined Under Namespace
Modules: Checks, GitDiffBase, LlmProviders Classes: CLI, ChangesDiff, CommandResult, CommandRunner, Configuration, DiffMap, Error, Formatter, GitHubReviewBuilder, GitHubReviewPublisher, LlmClient, LlmConfig, LlmLogger, LlmProviderError, MissingLlmConfigurationError, Options, PromptBuilder, PromptLoader, Result, Run, RunArtifacts, Runner, TargetResolver, UnsupportedLlmProviderError
Constant Summary collapse
- VERSION =
Gem version
"0.2.0"
Instance Attribute Summary collapse
-
#artifacts ⇒ RunArtifacts?
readonly
Artifacts associated with this run.
-
#checks ⇒ Array<String>
readonly
Names of checks that were run.
-
#format ⇒ String
readonly
Output format (human, agent, github).
-
#results ⇒ Array<Result>
readonly
Findings from the quality checks.
-
#review_id ⇒ String
readonly
Deterministic identifier for the reviewed diff.
-
#ruby_files ⇒ Array<String>
readonly
Ruby file paths that were analyzed.
-
#run_directory ⇒ String
readonly
Path to the directory containing run artifacts.
-
#target_files ⇒ Array<String>
readonly
File paths that were analyzed.
-
#timestamp ⇒ Integer
readonly
Epoch milliseconds when the run started.
Instance Method Summary collapse
-
#openai ⇒ Object
Register all supported LLM APIs for formatting output here.
-
#Reek ⇒ Object
Register all supported tools for analysing code here.
Instance Attribute Details
#artifacts ⇒ RunArtifacts? (readonly)
Returns artifacts associated with this run.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#checks ⇒ Array<String> (readonly)
Returns names of checks that were run.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#format ⇒ String (readonly)
Returns output format (human, agent, github).
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#results ⇒ Array<Result> (readonly)
Returns findings from the quality checks.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#review_id ⇒ String (readonly)
Returns deterministic identifier for the reviewed diff.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#ruby_files ⇒ Array<String> (readonly)
Returns Ruby file paths that were analyzed.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#run_directory ⇒ String (readonly)
Returns path to the directory containing run artifacts.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#target_files ⇒ Array<String> (readonly)
Returns file paths that were analyzed.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
#timestamp ⇒ Integer (readonly)
Returns epoch milliseconds when the run started.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cleo_quality_review/run.rb', line 27 Run = Struct.new( :timestamp, :review_id, :base_ref, :format, :checks, :target_files, :ruby_files, :run_directory, :results, :artifacts, :log, keyword_init: true, ) do ## # Convert the run to a hash representation # @return [Hash{Symbol => Object}] def to_h { timestamp: , review_id: review_id, base_ref: comparison_base_ref, format: format, checks: checks, target_files: target_files, ruby_files: ruby_files, run_directory: run_directory, changes_diff: artifacts&.changes_diff, check_outputs: check_outputs, findings: Array(results).map(&:to_h), } end ## # Build array of check output hashes for serialization # @return [Array<Hash{Symbol => String}>] def check_outputs return [] unless artifacts artifacts.raw_check_output_records.map(&:to_h) end ## # Build manifest data for artifact persistence # @return [Hash{Symbol => Object}] def manifest_data { review_id: review_id, base_ref: comparison_base_ref, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end private def comparison_base_ref base_ref || GitDiffBase::DEFAULT_BASE_REF end end |
Instance Method Details
#openai ⇒ Object
Register all supported LLM APIs for formatting output here
21 |
# File 'lib/cleo_quality_review.rb', line 21 LlmProviders.register("openai", LlmProviders::OpenAi::Provider) |