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
- func (lns LineNumbers) BeforeForAfter(line int) int
- func (lns LineNumbers) HasAfter(line int) bool
- func (lns LineNumbers) HasAnyAfter(line int) bool
- func (lns LineNumbers) HasBefore(line int) bool
- func (lns LineNumbers) Nearest(target, rangeFirst, rangeLast int) (int, bool)
- func (lns LineNumbers) String() string
- 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) HasAnyAfter ¶ added in v0.83.0
func (lns LineNumbers) HasAnyAfter(line int) bool
func (LineNumbers) HasBefore ¶ added in v0.81.0
func (lns LineNumbers) HasBefore(line int) bool
func (LineNumbers) Nearest ¶ added in v0.83.0
func (lns LineNumbers) Nearest(target, rangeFirst, rangeLast int) (int, bool)
Nearest finds the closest line to the target within changedLines. It prefers lines after the target over lines before and lines within the range, but can select nearest line outside of the range if needed. Returns (0, false) if there are no usable entries.
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.