ripsrc

package
v0.0.0-...-ca61a64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitFileCommitStatusAdded is the added status
	GitFileCommitStatusAdded = commitmeta.GitFileCommitStatusAdded
	// GitFileCommitStatusModified is the modified status
	GitFileCommitStatusModified = commitmeta.GitFileCommitStatusModified
	// GitFileCommitStatusRemoved is the removed status
	GitFileCommitStatusRemoved = commitmeta.GitFileCommitStatusRemoved
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlameLine

type BlameLine struct {
	Name    string
	Email   string
	Date    time.Time
	Comment bool
	Code    bool
	Blank   bool
	SHA     string
}

BlameLine is a single line entry in blame

type BlameResult

type BlameResult struct {
	Commit             Commit
	Language           string
	Filename           string
	Lines              []*BlameLine
	Size               int64
	Loc                int64
	Sloc               int64
	Comments           int64
	Blanks             int64
	Complexity         int64
	WeightedComplexity float64
	Skipped            string
	License            *License
	Status             CommitStatus
}

BlameResult holds details about the blame result

type Branch

type Branch = branches2.Branch

Branch contains information about the branch and commits on that branch.

type CodeInfoTimings

type CodeInfoTimings struct {
	Count int
	Time  time.Duration
}

func (*CodeInfoTimings) OutputStats

func (s *CodeInfoTimings) OutputStats(wr io.Writer)

type Commit

type Commit = commitmeta.Commit

Commit is a specific detail around a commit

type CommitCode

type CommitCode struct {
	Commit
	Blames chan BlameResult
}

type CommitFile

type CommitFile = commitmeta.CommitFile

CommitFile is a specific detail around a file in a commit

type CommitStatus

type CommitStatus = commitmeta.CommitStatus

CommitStatus is a commit status type

type License

type License = fileinfo.License

License holds details about detected license

type Opts

type Opts struct {
	// RepoDir git repo to run commands on.
	RepoDir string

	// Logger object for info and debug.
	Logger logger.Logger

	// CheckpointsDir is the directory to store incremental data cache for this repo.
	// If empty, directory is created inside repoDir.
	CheckpointsDir string

	// NoStrictResume forces incremental processing to avoid checking that it continues from the same commit in previously finished on. Since incrementals save a large number of previous commits, it works even starting on another commit.
	NoStrictResume bool

	// CommitFromIncl process starting from this commit (including this commit).
	CommitFromIncl string

	// CommitFromMakeNonIncl by default we start from passed commit and include it. Set CommitFromMakeNonIncl to true to avoid returning it, and skipping reading/writing checkpoint.
	CommitFromMakeNonIncl bool

	// IncrementalIgnoreBranchesOlderThan provides a way to ignore old branches in incremental processing.
	// Default is time.Now() - 90 * day
	// BUG: this field is ignored, only processing HEAD branch in incrementals right now
	IncrementalIgnoreBranchesOlderThan time.Time

	// AllBranches set to true to process all branches. If false, processes HEAD only.
	// BUG: in incrementals only processing HEAD branch
	AllBranches bool

	// BranchesUseOrigin by default ripsrc lists only local branches when using Branches method. Set this to true to use origin/ branches instead.
	BranchesUseOrigin bool

	// PullRequestSHAs is a list of custom sha references to process similar to branches returned from the repo.
	PullRequestSHAs []string
}

Opts is configuration for running ripsrc on a single repo.

type Ripsrc

type Ripsrc struct {
	GitProcessTimings process.Timing
	CodeInfoTimings   *CodeInfoTimings
	// contains filtered or unexported fields
}

Ripsrc runs on a single repo.

func New

func New(opts Opts) *Ripsrc

func (*Ripsrc) Branches

func (s *Ripsrc) Branches(ctx context.Context, res chan Branch) error

func (*Ripsrc) BranchesSlice

func (s *Ripsrc) BranchesSlice(ctx context.Context) (res []Branch, _ error)

func (*Ripsrc) Code

func (s *Ripsrc) Code(ctx context.Context, res chan BlameResult) error

Code returns code information using one record per file and commit

func (*Ripsrc) CodeByCommit

func (s *Ripsrc) CodeByCommit(ctx context.Context, res chan CommitCode) error

CodeByCommit returns code information using one record per commit that includes records by file

func (*Ripsrc) CodeSlice

func (s *Ripsrc) CodeSlice(ctx context.Context) (res []BlameResult, _ error)

Directories

Path Synopsis
cmd
history3
incblame
Package incblame generates blame data incrementally based on history of patches.
Package incblame generates blame data incrementally based on history of patches.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL