Files
eleithandeleith d669ce2345 refactor(coverage): centralize test coverage logic (#14)
- Excluded packages are now hardcoded in list-packages.sh.
- check-coverage.sh now uses list-packages.sh.
- The Makefile now calls check-coverage.sh.

This unifies the test coverage process for local and CI environments.

Reviewed-on: #14
Co-authored-by: eleith
Co-committed-by: eleith
2025-07-24 14:23:33 +00:00

19 lines
489 B
Bash
Executable File

#!/bin/sh
# This script generates a comma-separated list of Go packages to include in coverage.
# It excludes packages matching patterns provided as arguments.
EXCLUDE_PATTERNS=""
# Add any additional exclusion patterns from arguments
for arg in "$@"; do
EXCLUDE_PATTERNS="${EXCLUDE_PATTERNS} ${arg}"
done
PACKAGE_LIST=$(go list ./...)
for pattern in ${EXCLUDE_PATTERNS}; do
PACKAGE_LIST=$(echo "${PACKAGE_LIST}" | grep -v "${pattern}")
done
echo "${PACKAGE_LIST}" | paste -sd, -