support

package
v0.0.0-...-6162cdc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSystemPrompt

func BuildSystemPrompt(rules []entities.Rule) string

BuildSystemPrompt assembles the system prompt from the given rules.

func BuildUserPrompt

func BuildUserPrompt(title string, sourceBranch string, targetBranch string, diffs []entities.FileDiff) string

BuildUserPrompt assembles the user prompt from PR metadata and file diffs.

func ClassifyFile

func ClassifyFile(path string) string

ClassifyFile returns the rule category for a file path based on its extension. Returns an empty string if the extension is not recognized.

func ClassifyFiles

func ClassifyFiles(paths []string) []string

ClassifyFiles returns the unique set of rule categories for the given file paths.

func ParseReviewResponse

func ParseReviewResponse(content string) (*entities.ReviewResult, error)

ParseReviewResponse parses an AI response string into a ReviewResult. It tries direct JSON parsing first, then extracts from markdown code fences, and falls back to treating the entire content as a summary.

func SplitUnifiedDiff

func SplitUnifiedDiff(fullDiff string) map[string]string

SplitUnifiedDiff splits a multi-file unified diff into per-file chunks. Each returned element is keyed by the new-side file path (b/...) with its diff hunk.

Types

type ParsedPRURL

type ParsedPRURL struct {
	ProviderType string
	Organization string
	Project      string // Azure DevOps only
	RepoName     string
	PRID         int
}

ParsedPRURL holds the components extracted from a pull request URL.

func ParsePullRequestURL

func ParsePullRequestURL(rawURL string) (*ParsedPRURL, error)

ParsePullRequestURL extracts provider, org, repo, and PR ID from a pull request URL. Delegates to gitforge's ParsePullRequestURL and converts the result to code-guru's ParsedPRURL.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL