annotations

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 annotations emits CI-native annotation lines from test and coverage reports, enabling inline PR comments and pipeline summaries.

GitHub Actions  ::error file=…,line=…,title=…::message
GitLab CI       ANSI-coloured lines to stdout

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteCovAnnotations

func WriteCovAnnotations(w io.Writer, rep *covmodel.CovReport, threshold float64, p Platform) error

WriteCovAnnotations emits one warning per file whose line coverage is below threshold, sorted worst-first, plus a summary error if overall is below too.

func WriteTestAnnotations

func WriteTestAnnotations(w io.Writer, rep *model.Report, p Platform) error

WriteTestAnnotations emits one annotation line per failed test case.

Types

type Platform

type Platform string

Platform selects the annotation syntax.

const (
	// GitHub is the annotation platform identifier for GitHub Actions.
	GitHub Platform = "github"
	// GitLab is the annotation platform identifier for GitLab CI.
	GitLab Platform = "gitlab"
	// Azure is the annotation platform identifier for Azure DevOps.
	Azure Platform = "azure"
	// Auto detects from $GITHUB_ACTIONS / $GITLAB_CI / $TF_BUILD; falls back to GitHub format.
	Auto Platform = "auto"
)

func Detect

func Detect() Platform

Detect returns the active Platform from environment variables.

Jump to

Keyboard shortcuts

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