gitea

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssueWebhookID = "issue"
	RepoWebhookID  = "repo"
)
View Source
const Name = "gitea"
View Source
const ReviewPrompt = `` /* 2347-byte string literal not displayed */

Variables

View Source
var (
	ErrMissingCommitMessage = fmt.Errorf("missing commit message in metadata")
	ErrMissingDiffContent   = fmt.Errorf("missing diff content")
	ErrEmptyPrompt          = fmt.Errorf("empty prompt after formatting")
)

Functions

This section is empty.

Types

type CodeContext added in v0.28.1

type CodeContext struct {
	Diff         string            `json:"diff"`
	FilesContext []map[string]any  `json:"files_context"`
	Metadata     map[string]string `json:"metadata"`
}

func (*CodeContext) Len added in v0.28.1

func (c *CodeContext) Len() int

type CodeIssue added in v0.28.1

type CodeIssue struct {
	FilePath    string `json:"file_path"`
	StartLine   int    `json:"start_line"`
	EndLine     int    `json:"end_line"`
	Description string `json:"description"`
	Suggestion  string `json:"suggestion"`
}

type Config added in v0.28.1

type Config struct {
	QualityThreshold  float64            `json:"quality_threshold" title:"Quality Threshold Score"`
	MaxSecurityIssues int                `json:"max_security_issues" title:"Maximum Number of Security Issues"`
	IgnorePatterns    []string           `json:"ignore_patterns" title:"Ignored File Patterns"`
	ScoringRules      map[string]float64 `json:"scoring_rules" title:"Scoring Rule Weights"`
	ContextWindow     int                `json:"context_window" title:"Code Context Window Size"`
	MaxTokens         int                `json:"max_tokens" title:"Maximum Token Count"`
}

func DefaultConfig added in v0.28.1

func DefaultConfig() *Config

type QualityMetric added in v0.28.1

type QualityMetric struct {
	SecurityScore     float64 `json:"security_score"`
	PerformanceScore  float64 `json:"performance_score"`
	ReadabilityScore  float64 `json:"readability_score"`
	BestPracticeScore float64 `json:"best_practice_score"`
}

type ReviewComment added in v0.28.1

type ReviewComment struct {
	Path     string `json:"path"`
	Line     int    `json:"line"`
	Body     string `json:"body"`
	CommitID string `json:"commit_id"`
}

type ReviewResult added in v0.28.1

type ReviewResult struct {
	Comments       []string         `json:"comments"`
	Suggestions    []string         `json:"suggestions"`
	Score          float64          `json:"score"`
	Issues         []*CodeIssue     `json:"issues"`
	SecurityIssues []*SecurityIssue `json:"security_issues"`
	QualityMetrics *QualityMetric   `json:"quality_metrics"`
}

type SecurityIssue added in v0.28.1

type SecurityIssue struct {
	Severity    string `json:"severity"`
	FilePath    string `json:"file_path"`
	StartLine   int    `json:"start_line"`
	EndLine     int    `json:"end_line"`
	Description string `json:"description"`
	Suggestion  string `json:"suggestion"`
}

Jump to

Keyboard shortcuts

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