cleo_quality_review 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cleo_quality_review
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Morrice
@@ -9,20 +9,6 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: debride
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - ">="
17
- - !ruby/object:Gem::Version
18
- version: '0'
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: '0'
26
12
  - !ruby/object:Gem::Dependency
27
13
  name: fasterer
28
14
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +66,6 @@ files:
80
66
  - lib/cleo_quality_review.rb
81
67
  - lib/cleo_quality_review/changes_diff.rb
82
68
  - lib/cleo_quality_review/checks.rb
83
- - lib/cleo_quality_review/checks/debride.rb
84
69
  - lib/cleo_quality_review/checks/fasterer.rb
85
70
  - lib/cleo_quality_review/checks/flog.rb
86
71
  - lib/cleo_quality_review/checks/quality_check.rb
@@ -89,12 +74,15 @@ files:
89
74
  - lib/cleo_quality_review/cli.rb
90
75
  - lib/cleo_quality_review/command_result.rb
91
76
  - lib/cleo_quality_review/command_runner.rb
77
+ - lib/cleo_quality_review/concurrent_executor.rb
92
78
  - lib/cleo_quality_review/configuration.rb
93
79
  - lib/cleo_quality_review/diff_map.rb
94
80
  - lib/cleo_quality_review/formatter.rb
95
81
  - lib/cleo_quality_review/git_diff_base.rb
82
+ - lib/cleo_quality_review/github_client.rb
96
83
  - lib/cleo_quality_review/github_review_builder.rb
97
84
  - lib/cleo_quality_review/github_review_publisher.rb
85
+ - lib/cleo_quality_review/incremental_base_resolver.rb
98
86
  - lib/cleo_quality_review/llm_client.rb
99
87
  - lib/cleo_quality_review/llm_config.rb
100
88
  - lib/cleo_quality_review/llm_errors.rb
@@ -115,6 +103,7 @@ files:
115
103
  - lib/cleo_quality_review/target_resolver.rb
116
104
  - lib/cleo_quality_review/version.rb
117
105
  - prompts/agent.md
106
+ - prompts/configuration.md
118
107
  - prompts/github.md
119
108
  - prompts/human.md
120
109
  - prompts/pr_review.md
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "json"
4
-
5
- require_relative "quality_check"
6
-
7
- module CleoQualityReview
8
- module Checks
9
- ##
10
- # Quality check implementation for Debride unused-code analyzer
11
- class Debride < QualityCheck
12
- self.check_name = "dead_code"
13
- self.tool_name = "debride"
14
- self.output_extension = "json"
15
-
16
- private
17
-
18
- def command(files)
19
- [ruby_executable, gem_executable("debride", "debride"), "--json", "--rails", *files]
20
- end
21
-
22
- def parse(stdout, stderr)
23
- findings = missing_methods(stdout).flat_map do |class_name, methods|
24
- results_for_class(class_name, methods)
25
- end
26
- return findings unless findings.empty? && stderr.to_s.strip != ""
27
-
28
- [result(check: "Execution error", message: stderr, filepath: nil)]
29
- end
30
-
31
- def missing_methods(stdout)
32
- parsed = JSON.parse(stdout.to_s)
33
- missing = parsed.fetch("missing", {})
34
- return {} unless missing.is_a?(Hash)
35
-
36
- missing
37
- rescue JSON::ParserError
38
- {}
39
- end
40
-
41
- def results_for_class(class_name, methods)
42
- Array(methods).map { |entry| method_to_result(class_name, entry) }
43
- end
44
-
45
- def method_to_result(class_name, entry)
46
- method_name, location = Array(entry)
47
- filepath, line = parse_location(location)
48
-
49
- result(
50
- check: "PotentialDeadMethod",
51
- message: "#{class_name}##{method_name} might not be called",
52
- filepath: filepath,
53
- line: line,
54
- )
55
- end
56
-
57
- def parse_location(location)
58
- match = location.to_s.match(/\A(?<filepath>.*):(?<line>\d+)(?:-\d+)?\z/)
59
- return [nil, nil] unless match
60
-
61
- match.values_at(:filepath, :line)
62
- end
63
- end
64
- end
65
- end