Skip to content

fix(go): handle 100% coverage in unit-cov-gaps - #29

Merged
retr0h merged 1 commit into
mainfrom
fix/cov-gaps-pipefail
Mar 29, 2026
Merged

fix(go): handle 100% coverage in unit-cov-gaps#29
retr0h merged 1 commit into
mainfrom
fix/cov-gaps-pipefail

Conversation

@retr0h

@retr0h retr0h commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix unit-cov-gaps recipe failing with exit code 1 when coverage is 100%
  • Root cause: with set -euo pipefail, grep -v '100.0%' returns exit code 1 when no lines match (all functions at 100%), killing the script before the if [ -z ] guard
  • Fix: append || true to the pipeline so the empty result flows to the existing empty-check logic

Test plan

  • Run just go::unit-cov-gaps on a project with 100% coverage — should print "No coverage gaps found." and exit 0
  • Run just go::unit-cov-gaps on a project with <100% coverage — should open the heatmap as before

🤖 Generated with Claude Code

With `set -euo pipefail`, the `grep -v` pipeline returns
exit code 1 when no lines match (i.e., when coverage is
100%), killing the script before the empty-check on line
105. Append `|| true` so the empty result flows through
to the existing `if [ -z ]` guard.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Thank you for contributing to this project! 😊🕹️

@retr0h
retr0h merged commit 277f752 into main Mar 29, 2026
4 checks passed
@retr0h
retr0h deleted the fix/cov-gaps-pipefail branch March 29, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant