Documentation
¶
Index ¶
- Constants
- func FormatChunkedCoverageSummary(plan ChunkPlan, chunksReviewed int, maxEntries int) string
- func FormatCoverageSummary(diff DiffSet, rendered RenderResult, maxOmittedEntries int) string
- func FormatInteractivePromptCoverageSummary(plan ChunkPlan, chunksIncluded int, maxEntries int) string
- func HasGeneratedHeader(patch string) bool
- func IsAllowableNotReviewedFile(file FileCoverage) bool
- func IsGeneratedPath(path string) bool
- func IsLargeLockfile(path string, diffBytes int) bool
- func IsLikelyBinaryPath(path string) bool
- type ChangeStatus
- type ChangedFile
- type ChunkOptions
- type ChunkPlan
- type CollectRequest
- type CoverageMode
- type CoverageSummary
- type DiffSet
- type FileCoverage
- type LocalCollector
- type PrepareRequest
- type PreparedDiff
- type RenderOptions
- type RenderResult
- type ReviewChunk
Constants ¶
View Source
const ( DefaultMaxTotalDiffBytes = 180000 DefaultMaxFileDiffBytes = 40000 DefaultMaxIncludedFiles = 80 DefaultMaxOmittedSummaryEntries = 100 LargeLockfileDiffBytes = 20000 )
View Source
const GitHubRawDiffSource = "github-raw-diff"
View Source
const LocalGitSource = "local-git"
Variables ¶
This section is empty.
Functions ¶
func FormatCoverageSummary ¶
func FormatCoverageSummary(diff DiffSet, rendered RenderResult, maxOmittedEntries int) string
func HasGeneratedHeader ¶
func IsAllowableNotReviewedFile ¶
func IsAllowableNotReviewedFile(file FileCoverage) bool
IsAllowableNotReviewedFile reports whether an unreviewed file is explicitly non-material.
func IsGeneratedPath ¶
func IsLargeLockfile ¶
func IsLikelyBinaryPath ¶
Types ¶
type ChangeStatus ¶
type ChangeStatus string
const ( ChangeAdded ChangeStatus = "added" ChangeModified ChangeStatus = "modified" ChangeDeleted ChangeStatus = "deleted" ChangeRenamed ChangeStatus = "renamed" ChangeCopied ChangeStatus = "copied" ChangeTypeChanged ChangeStatus = "type_changed" ChangeUnknown ChangeStatus = "unknown" )
type ChangedFile ¶
type ChangedFile struct {
Path string
OldPath string
Status ChangeStatus
Additions int
Deletions int
Changes int
Patch string
Binary bool
Generated bool
Large bool
Truncated bool
Omitted bool
OmitReason string
PreviousMode string
CurrentMode string
}
func MarkGeneratedAndLarge ¶
func MarkGeneratedAndLarge(file ChangedFile, opts RenderOptions) ChangedFile
type ChunkOptions ¶
type ChunkOptions struct {
MaxChunkBytes int
MaxFileDiffBytes int
MaxFilesPerChunk int
MaxChunks int
MaxOmittedSummaryEntries int
}
func DefaultChunkOptions ¶
func DefaultChunkOptions() ChunkOptions
type ChunkPlan ¶
type ChunkPlan struct {
DiffSet DiffSet
Chunks []ReviewChunk
Coverage CoverageSummary
Warnings []string
}
func ChunkForReview ¶
func ChunkForReview(diff DiffSet, opts ChunkOptions) ChunkPlan
type CollectRequest ¶
type CoverageMode ¶
type CoverageMode string
const ( CoverageModeFull CoverageMode = "full" CoverageModeChunked CoverageMode = "chunked" CoverageModePartial CoverageMode = "partial" )
type CoverageSummary ¶
type CoverageSummary struct {
Source string
TotalFiles int
ReviewMode CoverageMode
ChunksPlanned int
ChunksReviewed int
FilesReviewed int
FilesReviewedWithTruncatedDiffs int
FilesSummarizedNotReviewed int
FilesNotReviewed int
OmittedByReason map[string]int
NotReviewedFiles []FileCoverage
ReviewedFiles []FileCoverage
TruncatedFiles []FileCoverage
Warnings []string
Complete bool
PartialReason string
ExceededMaxChunks bool
RequiredChunks int
MaxChunks int
}
type DiffSet ¶
type DiffSet struct {
PRNumber int
BaseSHA string
HeadSHA string
Source string
Files []ChangedFile
Warnings []string
}
func FromPlatformFiles ¶
type FileCoverage ¶
type LocalCollector ¶
func (LocalCollector) Collect ¶
func (c LocalCollector) Collect(ctx context.Context, req CollectRequest) (DiffSet, error)
type PrepareRequest ¶
type PreparedDiff ¶
type PreparedDiff struct {
DiffSet DiffSet
Rendered RenderResult
Chunks []ReviewChunk
Coverage CoverageSummary
}
func PrepareForReview ¶
func PrepareForReview(ctx context.Context, req PrepareRequest) (PreparedDiff, error)
type RenderOptions ¶
type RenderOptions struct {
MaxTotalDiffBytes int
MaxFileDiffBytes int
MaxIncludedFiles int
MaxOmittedSummaryEntries int
}
func DefaultRenderOptions ¶
func DefaultRenderOptions() RenderOptions
type RenderResult ¶
type RenderResult struct {
Text string
IncludedFiles []ChangedFile
OmittedFiles []ChangedFile
TruncatedFiles []ChangedFile
Warnings []string
WasLimited bool
}
func RenderForReview ¶
func RenderForReview(diff DiffSet, opts RenderOptions) RenderResult
type ReviewChunk ¶
type ReviewChunk struct {
Index int
Total int
Text string
IncludedFiles []ChangedFile
OmittedFiles []ChangedFile
TruncatedFiles []ChangedFile
Warnings []string
UsedDiffBytes int
WasLimited bool
}
Click to show internal directories.
Click to hide internal directories.