fix(go-gitignore): prevent coverage.go files from being excluded by tdabasinskas · Pull Request #4776 · github/gitignore · GitHub
Skip to content

fix(go-gitignore): prevent coverage.go files from being excluded - #4776

Merged
wirecat merged 1 commit into
github:mainfrom
tdabasinskas:go-ignore-coverage-fix
Oct 2, 2026
Merged

wirecat merged 1 commit into
github:mainfrom
tdabasinskas:go-ignore-coverage-fix

Conversation

@tdabasinskas

@tdabasinskas tdabasinskas commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor

Reasons for making this change

The current coverage.* pattern unintentionally matches *.go files. When using Go vendoring, this causes legitimate source files to be excluded from version control:

  • vendor/golang.org/x/text/internal/language/coverage.go
  • vendor/golang.org/x/text/language/coverage.go

This leads to a particularly difficult-to-debug scenario where local builds succeed but CI pipelines fail due to missing vendored files that were never committed.

Adding !coverage.go ensures that Go source files are not accidentally excluded by the coverage.* pattern.

Links to documentation supporting these rule changes

If this is a new template

N/A — This is a modification to 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

The current `coverage.*` pattern includes `*.go` files as well. If you use `go vendor`, this causes the following files to be excluded:

- `vendor/golang.org/x/text/internal/language/coverage.go`
- `vendor/golang.org/x/text/language/coverage.go`

This becomes a nightmare to troubleshoot why the local build works, yet a CI fails (as the files were not committed).

Adding `!coverage.go` ensure that `*.go` files do not get accidentally excluded.
@tdabasinskas
tdabasinskas requested a review from a team as a code owner December 24, 2025 09:49
@github-actions

Copy link
Copy Markdown

@github-actions github-actions Bot added the stale label Mar 24, 2026
@github-actions github-actions Bot removed the stale label May 25, 2026
@github-actions

Copy link
Copy Markdown

@github-actions github-actions Bot added the stale label Aug 24, 2026

@wirecat wirecat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing!

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.

4 participants