parser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package parser defines the CovParser interface and global registry for coverage format auto-detection and dispatch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFile

func ParseFile(path string, p CovParser, stripPrefix string) (*covmodel.CovReport, error)

ParseFile opens path and parses it; if p is nil format is auto-detected. Use "-" for stdin.

func Register

func Register(p CovParser)

Register adds p to the global registry. Earlier registrations win on Detect.

Types

type CovParser

type CovParser interface {
	Name() string
	Extensions() []string
	Detect(header []byte) bool
	Parse(r io.Reader, source string) (*covmodel.CovReport, error)
}

CovParser converts a specific coverage format into a covmodel.CovReport.

func ForName

func ForName(name string) (CovParser, error)

ForName returns the parser for the given name or alias.

Directories

Path Synopsis
Package clover parses Clover XML coverage files.
Package clover parses Clover XML coverage files.
Package cobertura parses Cobertura XML coverage files produced by JaCoCo, coverage.py (pytest-cov), .NET coverlet, and compatible tools.
Package cobertura parses Cobertura XML coverage files produced by JaCoCo, coverage.py (pytest-cov), .NET coverlet, and compatible tools.
Package gocover parses Go coverage profiles produced by go test -coverprofile=coverage.out (mode: set | count | atomic).
Package gocover parses Go coverage profiles produced by go test -coverprofile=coverage.out (mode: set | count | atomic).
Package lcov parses LCOV .info coverage files produced by gcov, Istanbul/nyc, Rust tarpaulin, and any other tool emitting the LCOV format.
Package lcov parses LCOV .info coverage files produced by gcov, Istanbul/nyc, Rust tarpaulin, and any other tool emitting the LCOV format.

Jump to

Keyboard shortcuts

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