Documentation
¶
Index ¶
- Constants
- func FormatCoverageSummary(diff DiffSet, rendered RenderResult, maxOmittedEntries int) string
- func HasGeneratedHeader(patch string) bool
- func IsGeneratedPath(path string) bool
- func IsLargeLockfile(path string, diffBytes int) bool
- func IsLikelyBinaryPath(path string) bool
- type ChangeStatus
- type ChangedFile
- type CollectRequest
- type DiffSet
- type LocalCollector
- type PrepareRequest
- type PreparedDiff
- type RenderOptions
- type RenderResult
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 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 CollectRequest ¶
type DiffSet ¶
type DiffSet struct {
PRNumber int
BaseSHA string
HeadSHA string
Source string
Files []ChangedFile
Warnings []string
}
func FromPlatformFiles ¶
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
}
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
Click to show internal directories.
Click to hide internal directories.