Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add a code coverage badge to CI

Open Beginner friendly
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, go

Research direction

Start with the single build-test job in .github/workflows/ci.yml and the CI badge at line 15 of the README. Add go test -coverprofile=coverage.out ./... and read the total with go tool cover -func, then add a push-to-main-only step that needs contents: write. Option A's text is garbled, so confirm with the maintainer which badge option to use. Done means coverage runs on every PR, the badge updates only on main, and the README shows it next to the CI badge.

Written by the indexing model from the issue text.

Description

documentation enhancement help wanted
What

Measure test coverage in CI and surface it as a badge in the README, next to the existing CI badge.

Current state

.github/workflows/ci.yml has one job, build-test, running go build ./..., go vet ./..., a gofmt check, and go test ./.... The README shows the CI badge at the top (line 15).

Proposed change
  1. In CI, produce a coverage profile:

    • go test -coverprofile=coverage.out ./...
    • total via go tool cover -func=coverage.out | tail -1 (prints something like total: (statements) 62.3%).
  2. Publish a badge — two options:

    Option A — no third party (recommended, fits the project's local-first ethos).
    Generate an SVG (for example with github.com/AlexBeauchemin/gobadge), commit it to a badges branch, and reference it:
    coverage
    The publish step needs permissions: contents: write and should run only on push to main.

  3. Add the chosen badge to the README next to the CI badge.

Acceptance criteria
  • CI computes coverage on every push and PR.
  • Badge renders in the README and updates on main (not on every PR).
  • Existing CI steps (build, vet, gofmt, test) keep running unchanged.
  • Note in the issue/PR that internal/plan and cmd/metcode have no tests, so the percentage reflects that.
Dominant language
Go
Stars
1
Forks
2
Avg merge
1h 31m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Edwin-metcalf/MetCode

All issues in Edwin-metcalf/MetCode

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.