fleetlint Policy for a fleet of repositories
v0.6
Getting started

quality/coverage-threshold/go

A coverage floor is enforced

Implements quality/coverage-threshold for go.

Severitywarning
Tiers1, 2
Stacksgo
Scopeeach
Kindoutcome
Sourcelibrary v0.3.1
Selected byfleetlint-recommended@v0.3.1

Requirement

go-test-coverage runs with a threshold (.testcoverage.yml with threshold.total/file/package, or the action with a threshold input), or a stack-neutral floor applies (the cover recipe compares with a minimum, diff-cover --fail-under, codecov target).

Why

A coverage number nobody enforces drifts down one “quick fix” at a time.

Parameters

  • skip: ^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b|(sudo\s+)?(go (install|get)|cargo b?install|pipx? install|pip3 install|python3? -m pip install|uv (tool |pip )?(install|add)|(npm|pnpm|yarn|bun) (i|install|add|global add)|gem install|bundle add|brew install|dotnet tool (install|update)|composer (global )?require|apt(-get)? install|curl|wget)\b[^;&]*$)

Fix

Add go-test-coverage with threshold: {total: 80} in .testcoverage.yml, or compare the go tool cover -func total with COVER_MIN in the cover recipe.

Agent instruction: Add a threshold to the cover recipe using the stack profile’s tool (go: go-test-coverage or a cover script with a minimum; python: –cov-fail-under; node: coverageThreshold; rust: cargo llvm-cov –fail-under-lines; kotlin: kover verify).

See: https://fleetlint.org/baseline/#tests, https://fleetlint.org/stacks/#go


Generated by fleetlint docs from catalog v0.3.1.