Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCoverageData = errors.New("invalid coverage data - unable to parse")
ErrInvalidCoverageData happens when the data passed to gocovparser is either blank or not a coverage.out file content.
var FileParseGroup = ParseGroup{ Name: "file", KeyFunc: func(filename string) string { return filename }, }
FileParseGroup returns each line as it's own key.
var PackageParseGroup = ParseGroup{ Name: "package", KeyFunc: func(filename string) string { parts := strings.Split(filename, "/") return strings.Join(parts[:len(parts)-1], "/") }, }
PackageParseGroup parses the package from the coverage data and uses that as identifier.
var TotalParseGroup = ParseGroup{ Name: "total", KeyFunc: func(string) string { return "total" }, }
TotalParseGroup uses 'total' as key to group all coverage data into a total.
Functions ¶
This section is empty.
Types ¶
type Coverage ¶
type Coverage struct { FileName string Blocks []cover.ProfileBlock Host string Owner string Repo string Path string }
Coverage line in a coverage.out file.
func FilterCoverage ¶ added in v0.3.0
FilterCoverage using the specified filters.
type Filter ¶ added in v0.3.0
Filter interface for filtering coverage by.
func FileExcludeFilter ¶ added in v0.3.0
FileExcludeFilter excludes any coverage that has a filename matching the specified regex.
func PackageExcludeFilter ¶ added in v0.3.0
PackageExcludeFilter excludes any coverage that matches the packageName specified.
type ParseGroup ¶
type ParseGroup struct { // Name of the parse group. Used to retrieve your parse data after grouping. Name string // KeyFunc that returns the grouping key to use based on the coverage line. KeyFunc func(string) string }
ParseGroup to group coverage data by.
type ParseGroupResult ¶
ParseGroupResult represents results of a Group Coverage operation.
func GroupCoverage ¶
func GroupCoverage(items []Coverage, groups ...ParseGroup) (ParseGroupResult, error)
GroupCoverage in the specified groups.