Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DifferInit ¶
type DifferInit struct {
// contains filtered or unexported fields
}
DifferInit Code DifferInitence Analyzer
func NewDifferInit ¶
func NewDifferInit(cfg *config.Config) (*DifferInit, error)
NewDifferInit creates a new code DifferInit
func (*DifferInit) AnalyzeChanges ¶
func (d *DifferInit) AnalyzeChanges() ([]*FileChange, error)
AnalyzeChanges analyzes code changes between new and initial commit
type DifferInterface ¶
type DifferInterface interface {
AnalyzeChanges() ([]*FileChange, error)
}
type DifferV1 ¶
type DifferV1 struct {
// contains filtered or unexported fields
}
DifferV1 is the first version of the code difference analyzer
func NewDifferV1 ¶
NewDifferV1 creates a new code difference analyzer
func (*DifferV1) AnalyzeChanges ¶
func (d *DifferV1) AnalyzeChanges() ([]*FileChange, error)
AnalyzeChanges analyzes code changes between two branches
type DifferV2 ¶
type DifferV2 struct {
// contains filtered or unexported fields
}
DifferV2 is the second version of the code difference analyzer
func NewDifferV2 ¶
NewDifferV2 creates a new code difference analyzer
func (*DifferV2) AnalyzeChanges ¶
func (d *DifferV2) AnalyzeChanges() ([]*FileChange, error)
AnalyzeChanges analyzes code changes between two branches
type DifferV3 ¶
type DifferV3 struct {
// contains filtered or unexported fields
}
This version cannot recognize the scenario of file migration and modification. All migrated files are regarded as deleted and newly created.
Blame the limited capabilities of go-git. I have tried various methods but still got no result.
DifferV3 is the third version of the code difference analyzer
func NewDifferV3 ¶
NewDifferV3 creates a new code DifferV3
func (*DifferV3) AnalyzeChanges ¶
func (d *DifferV3) AnalyzeChanges() ([]*FileChange, error)
AnalyzeChanges analyzes code changes between two branches
type FileChange ¶
type FileChange struct {
Path string `json:"path"` // file path
LineChanges LineChanges `json:"line_changes"`
}
FileChange represents file change information
type LineChange ¶
type LineChange struct {
Start int `json:"start"` // starting line number of new code
Lines int `json:"lines"` // number of lines of new code
}
LineChange represents line-level change information
type LineChanges ¶
type LineChanges []LineChange
LineChanges is a list of line changes
func (LineChanges) Search ¶
func (l LineChanges) Search(line int) int
Search searches for a line change