Documentation
¶
Overview ¶
Package changed resolves source lines owned by a Git change relative to a deterministic merge base.
Index ¶
- type LineRange
- type Scope
- func (s *Scope) Changed(path string) bool
- func (s *Scope) Contains(path string) bool
- func (s *Scope) FilterDiagnostics(file *source.File, diagnostics []rules.Diagnostic) ([]rules.Diagnostic, []rules.Diagnostic, error)
- func (s *Scope) Lines(path string) []LineRange
- func (s *Scope) MergeBase() string
- func (s *Scope) OwnsTransformation(file *source.File, after []byte) (bool, error)
- func (s *Scope) Root() string
- func (s *Scope) WholeFile(path string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope is one immutable repository change relative to a resolved merge base.
func Resolve ¶
Resolve discovers the containing Git repository and computes current source lines changed since the merge base shared by base and HEAD.
func (*Scope) FilterDiagnostics ¶
func (s *Scope) FilterDiagnostics( file *source.File, diagnostics []rules.Diagnostic, ) ([]rules.Diagnostic, []rules.Diagnostic, error)
FilterDiagnostics retains diagnostics intersecting changed lines, records pre-existing diagnostics separately, and exposes only fixes wholly owned by the changed lines.
func (*Scope) OwnsTransformation ¶
OwnsTransformation reports whether every original source line changed by after belongs to the changed-code scope.
Click to show internal directories.
Click to hide internal directories.