coverage

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteBaseline

func WriteBaseline(path string, baseline Baseline) error

Types

type Baseline

type Baseline struct {
	SchemaVersion int              `json:"schema_version"`
	ModulePath    string           `json:"module_path"`
	Total         Ratio            `json:"total"`
	Packages      map[string]Ratio `json:"packages"`
}

func NewBaseline

func NewBaseline(modulePath string, snapshot Snapshot) Baseline

func ReadBaseline

func ReadBaseline(path string) (Baseline, error)

type Ratio

type Ratio struct {
	Covered    int64 `json:"covered"`
	Statements int64 `json:"statements"`
}

func (Ratio) Percent

func (r Ratio) Percent() float64

type Regression

type Regression struct {
	Scope    Scope
	Name     string
	Baseline Ratio
	Current  Ratio
}

func Compare

func Compare(baseline Baseline, current Snapshot) []Regression

type Scope

type Scope string
const (
	ScopeTotal   Scope = "total"
	ScopePackage Scope = "package"
)

type Snapshot

type Snapshot struct {
	Total    Ratio
	Packages map[string]Ratio
}

func ParseSnapshot

func ParseSnapshot(r io.Reader) (Snapshot, error)

Jump to

Keyboard shortcuts

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