coverage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const IgnoreText = "coverage-ignore"

Variables

View Source
var ErrInvalidFormat = errors.New("invalid format")

Functions

func CoveredPercentage

func CoveredPercentage(total, covered int64) int

func StatsPluckName

func StatsPluckName(stats []Stats) []string

func StatsSearchMap

func StatsSearchMap(stats []Stats) map[string]Stats

func StatsSerialize

func StatsSerialize(stats []Stats) []byte

Types

type Config

type Config struct {
	Profiles               []string
	ExcludePaths           []string
	SourceDir              string
	ForceAnnotationComment bool
}

type FileCoverageDiff

type FileCoverageDiff struct {
	Current Stats  `json:"current"`
	Base    *Stats `json:"base,omitempty"`
}

FileCoverageDiff holds per-file coverage difference between current and base.

type Stats

type Stats struct {
	Name                       string
	Total                      int64
	Covered                    int64
	Threshold                  int
	UncoveredLines             []int
	AnnotationsWithoutComments []int
}

func GenerateCoverageStats

func GenerateCoverageStats(log *zap.Logger, cfg Config) ([]Stats, error)

func StatsCalcTotal

func StatsCalcTotal(stats []Stats) Stats

func StatsDeserialize

func StatsDeserialize(b []byte) ([]Stats, error)

func StatsFilterWithCoveredLines

func StatsFilterWithCoveredLines(stats []Stats) []Stats

func StatsFilterWithMissingExplanations

func StatsFilterWithMissingExplanations(stats []Stats) []Stats

StatsFilterWithMissingExplanations returns stats that have missing explanations

func StatsFilterWithUncoveredLines

func StatsFilterWithUncoveredLines(stats []Stats) []Stats

func (Stats) CoveredPercentage

func (s Stats) CoveredPercentage() int

func (Stats) CoveredPercentageF

func (s Stats) CoveredPercentageF() float64

func (Stats) CoveredPercentageFNR

func (s Stats) CoveredPercentageFNR() float64

func (Stats) Str

func (s Stats) Str() string

func (Stats) UncoveredLinesCount

func (s Stats) UncoveredLinesCount() int

Jump to

Keyboard shortcuts

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