Documentation
¶
Index ¶
- func CommitMessage(cmd CommandRunner, sha string) (string, error)
- func CountLines(body []byte) int
- func RunGit(args ...string) (content []byte, err error)
- type BodyDiff
- type CommandRunner
- type FileChange
- type FileStatus
- type Info
- type LineNumber
- type LineNumbers
- type LineRangeSide
- type Path
- type PathDiff
- type PathFilter
- type PathType
- type TypeDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitMessage ¶ added in v0.17.0
func CommitMessage(cmd CommandRunner, sha string) (string, error)
func CountLines ¶ added in v0.40.1
Types ¶
type BodyDiff ¶ added in v0.40.1
type BodyDiff struct {
Before []byte
After []byte
Lines LineNumbers
}
type CommandRunner ¶
type FileChange ¶ added in v0.40.1
type FileChange struct {
Path PathDiff
Body BodyDiff
Commits []string
Status FileStatus
}
func Changes ¶ added in v0.40.1
func Changes(cmd CommandRunner, baseBranch string, filter PathFilter) ([]*FileChange, error)
type FileStatus ¶ added in v0.40.1
type FileStatus rune
const ( FileAdded FileStatus = 'A' FileCopied FileStatus = 'C' FileDeleted FileStatus = 'D' FileRenamed FileStatus = 'R' FileModified FileStatus = 'M' FileTypeChanged FileStatus = 'T' )
type Info ¶ added in v0.82.3
func Describe ¶ added in v0.82.3
func Describe(cmd CommandRunner) (Info, error)
type LineNumber ¶ added in v0.81.0
func (LineNumber) String ¶ added in v0.81.0
func (ln LineNumber) String() string
type LineNumbers ¶ added in v0.81.0
type LineNumbers []LineNumber
func MakeLineRangeFromTo ¶ added in v0.81.0
func MakeLineRangeFromTo(first, last int, side LineRangeSide) LineNumbers
func (LineNumbers) BeforeForAfter ¶ added in v0.81.0
func (lns LineNumbers) BeforeForAfter(line int) int
BeforeForAfter returns the old (before the change) line number for a given new (after the change) line number.
LineNumbers contains explicit mappings for changed, deleted, added, and shifted lines. Unchanged lines that were not shifted are not stored.
Returns:
- Before value if the line is present in LineNumbers.
- Line itself if no mapping exists (unchanged and unshifted).
func (LineNumbers) HasAfter ¶ added in v0.81.0
func (lns LineNumbers) HasAfter(line int) bool
func (LineNumbers) HasBefore ¶ added in v0.81.0
func (lns LineNumbers) HasBefore(line int) bool
func (LineNumbers) NearestAfter ¶ added in v0.81.0
func (lns LineNumbers) NearestAfter(target int) int
NearestAfter returns the Modified After line number closest to the given target. Only considers entries where Modified is true, consistent with HasAfter. Returns 0 if there are no modified entries with After > 0.
func (LineNumbers) NearestBefore ¶ added in v0.81.0
func (lns LineNumbers) NearestBefore(target int) int
NearestBefore returns the Before line number closest to the given target. Returns 0 if there are no entries with Before > 0.
func (LineNumbers) String ¶ added in v0.81.0
func (lns LineNumbers) String() string
type LineRangeSide ¶ added in v0.81.0
type LineRangeSide uint8
const ( LinesBefore LineRangeSide = iota LinesAfter LinesBoth )
type Path ¶ added in v0.40.1
func (Path) EffectivePath ¶ added in v0.40.1
type PathFilter ¶ added in v0.51.0
type PathFilter struct {
// contains filtered or unexported fields
}
func NewPathFilter ¶ added in v0.51.0
func NewPathFilter(include, exclude, relaxed []*regexp.Regexp) PathFilter
func (PathFilter) IsPathAllowed ¶ added in v0.51.0
func (pf PathFilter) IsPathAllowed(path string) (ok bool)
func (PathFilter) IsRelaxed ¶ added in v0.51.0
func (pf PathFilter) IsRelaxed(path string) bool
Click to show internal directories.
Click to hide internal directories.