Documentation
¶
Index ¶
- type CodeReviewer
- func (r *CodeReviewer) CurrentCommit(ctx context.Context) (string, error)
- func (r *CodeReviewer) HasReviewed(commit string) bool
- func (r *CodeReviewer) IsInitialCommit(commit string) bool
- func (r *CodeReviewer) ModTidy(ctx context.Context) ([]string, error)
- func (r *CodeReviewer) RequireNoUncommittedChanges(ctx context.Context) error
- func (r *CodeReviewer) RequireNormalGitState(_ context.Context) error
- func (r *CodeReviewer) ResolveCommit(ctx context.Context, ref string) (string, error)
- func (r *CodeReviewer) Run(ctx context.Context, m json.RawMessage) llm.ToolOut
- func (r *CodeReviewer) RunMechanicalChecks(ctx context.Context) string
- func (r *CodeReviewer) Tool() *llm.Tool
- func (r *CodeReviewer) WarmTestCache(modifiedFile string)
- type GoplsIssue
- type RelatedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeReviewer ¶
type CodeReviewer struct {
// contains filtered or unexported fields
}
A CodeReviewer manages quality checks.
func NewCodeReviewer ¶
func NewCodeReviewer(ctx context.Context, repoRoot, sketchBaseRef string) (*CodeReviewer, error)
func (*CodeReviewer) CurrentCommit ¶
func (r *CodeReviewer) CurrentCommit(ctx context.Context) (string, error)
CurrentCommit retrieves the current git commit hash
func (*CodeReviewer) HasReviewed ¶
func (r *CodeReviewer) HasReviewed(commit string) bool
func (*CodeReviewer) IsInitialCommit ¶
func (r *CodeReviewer) IsInitialCommit(commit string) bool
func (*CodeReviewer) ModTidy ¶
func (r *CodeReviewer) ModTidy(ctx context.Context) ([]string, error)
ModTidy runs go mod tidy if go module files have changed. Returns a list of files changed by go mod tidy (empty if none).
func (*CodeReviewer) RequireNoUncommittedChanges ¶
func (r *CodeReviewer) RequireNoUncommittedChanges(ctx context.Context) error
func (*CodeReviewer) RequireNormalGitState ¶
func (r *CodeReviewer) RequireNormalGitState(_ context.Context) error
RequireNormalGitState checks that the git repo state is pretty normal.
func (*CodeReviewer) ResolveCommit ¶
func (*CodeReviewer) Run ¶
func (r *CodeReviewer) Run(ctx context.Context, m json.RawMessage) llm.ToolOut
func (*CodeReviewer) RunMechanicalChecks ¶
func (r *CodeReviewer) RunMechanicalChecks(ctx context.Context) string
RunMechanicalChecks runs all mechanical checks and returns a message describing any changes made.
func (*CodeReviewer) Tool ¶
func (r *CodeReviewer) Tool() *llm.Tool
Tool returns a tool spec for a CodeReview tool backed by r.
func (*CodeReviewer) WarmTestCache ¶
func (r *CodeReviewer) WarmTestCache(modifiedFile string)
WarmTestCache runs 'go test -c' on relevant packages in the background to warm up the Go build cache. This is intended to be called after patch operations to prepare for future differential testing. It uses the base commit (before state) to warm cache for packages that will likely be tested during code review.
type GoplsIssue ¶
type GoplsIssue struct {
Position string // File position in format "file:line:col-range"
Message string // Description of the issue
}
GoplsIssue represents a single issue reported by gopls check
type RelatedFile ¶
type RelatedFile struct {
Path string // Path to the file
Correlation float64 // Correlation score (0.0-1.0)
}
RelatedFile represents a file historically related to the changed files