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/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, 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.1.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.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#checks ⇒ Array<String> (readonly)
Returns names of checks that were run.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#format ⇒ String (readonly)
Returns output format (human, agent, github).
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#results ⇒ Array<Result> (readonly)
Returns findings from the quality checks.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#review_id ⇒ String (readonly)
Returns deterministic identifier for the reviewed diff.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#ruby_files ⇒ Array<String> (readonly)
Returns Ruby file paths that were analyzed.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#run_directory ⇒ String (readonly)
Returns path to the directory containing run artifacts.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#target_files ⇒ Array<String> (readonly)
Returns file paths that were analyzed.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } end end |
#timestamp ⇒ Integer (readonly)
Returns epoch milliseconds when the run started.
25 26 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 |
# File 'lib/cleo_quality_review/run.rb', line 25 Run = Struct.new( :timestamp, :review_id, :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, 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, timestamp: , checks: checks, target_files: target_files, ruby_files: ruby_files, } 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) |