fix(Go.gitignore): replace broad coverage.* glob with explicit coverage artifacts by ashwingopalsamy · Pull Request #4925 · github/gitignore · GitHub
Skip to content

fix(Go.gitignore): replace broad coverage.* glob with explicit coverage artifacts - #4925

Open
ashwingopalsamy wants to merge 1 commit into
github:mainfrom
ashwingopalsamy:fix/go-coverage-glob
Open

ashwingopalsamy wants to merge 1 commit into
github:mainfrom
ashwingopalsamy:fix/go-coverage-glob

Conversation

@ashwingopalsamy

Copy link
Copy Markdown
Contributor

Reasons for making this change

coverage.* (added in #4565, my PR) is too broad. #4776 patched one case with !coverage.go, but the glob still silently ignores files that belong in a Go repo:

File Ignored today Impact
api/coverage.pb.go, api/coverage.proto yes builds locally, CI fails (same failure mode #4776 reported)
.github/workflows/coverage.yml yes CI workflow never gets committed
scripts/coverage.sh, coverage.md yes scripts/docs silently dropped

Verified with git check-ignore -v against current main.

This replaces the glob (and the !coverage.go exception) with the coverage artifacts Go tooling actually writes:

  • coverage.out → already covered by *.out
  • coverage.txt → Codecov's Go convention
  • coverage.html → go tool cover -html=… -o coverage.html
  • coverage.xml → gocover-cobertura output
  • *.coverprofile, profile.cov → unchanged

Trade-off: a coverage file with an unusual name now shows up in git status (visible, easy to add locally) instead of source/config files disappearing silently.

Links to documentation supporting these rule changes

If this is a new template

N/A, this changes an existing template.

Merge and Approval Steps

  • Confirm that you've read the contribution guidelines and ensured your PR aligns
  • Ensure CI is passing
  • Get a review and Approval from one of the maintainers

@ashwingopalsamy
ashwingopalsamy requested a review from a team as a code owner October 10, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant