Coverage is currently unmeasurable without violating repo policy. Only make
targets and script/ entrypoints may be used, and no target reports coverage
detail — so "which functions are untested?" can only be answered by grepping
test files for identifiers by hand.
That is exactly how the current coverage gaps (#5 rings, #6 sticks, #7 wizard, #14 traps) had to be found, and it is slow and error-prone.
Note #2 adds -cover to make test, which prints a single per-package
percentage. That is a coarse signal — useful as a trend, useless for finding which function is uncovered. This issue is about the per-function view.
Definition of done
A make cover target that produces a per-function coverage report
(the -coverprofile + go tool cover -func shape), so specific untested
functions are identifiable.
An HTML report is generated or trivially obtainable — either a second
target (make cover-html) or a documented one-liner in the README.
The coverage profile is written somewhere ignored by git, and .gitignore
is updated so a stray profile can never be committed.
make check must not run make cover and must remain non-file-
modifying — policy requires make check not to modify any files in the
repo. Verify this: run make check, then confirm git status is clean.
The README's make-target list mentions the new target.
make check fully green.
TODO.md updated in the same commit.
Commit title ends with (closes #N).
Implementation requirements
Follow the existing Makefile's conventions: $(GO_PKGS), the .PHONY
line, and a short comment above the target like its neighbors.
Do NOT add a Dockerfile, CI config, or script/ entrypoints — this repo is
exempt.
Do NOT modify .golangci.yml.
No Go source changes; this is build tooling only.
make targets only for verification.
Never mention Claude or Anthropic anywhere.
Priority
Low — this is a tooling convenience. It is genuinely more valuable before
the four coverage issues than after, since it turns "did we actually improve
coverage?" into a measurable question, but it does not block them.
## Problem
Coverage is currently unmeasurable without violating repo policy. Only `make`
targets and `script/` entrypoints may be used, and no target reports coverage
detail — so "which functions are untested?" can only be answered by grepping
test files for identifiers by hand.
That is exactly how the current coverage gaps (#5 rings, #6 sticks, #7 wizard,
#14 traps) had to be found, and it is slow and error-prone.
Note #2 adds `-cover` to `make test`, which prints a single per-package
percentage. That is a coarse signal — useful as a trend, useless for finding
*which* function is uncovered. This issue is about the per-function view.
## Definition of done
1. A `make cover` target that produces a **per-function** coverage report
(the `-coverprofile` + `go tool cover -func` shape), so specific untested
functions are identifiable.
2. An HTML report is generated or trivially obtainable — either a second
target (`make cover-html`) or a documented one-liner in the README.
3. The coverage profile is written somewhere ignored by git, and `.gitignore`
is updated so a stray profile can never be committed.
4. `make check` must **not** run `make cover` and must remain non-file-
modifying — policy requires `make check` not to modify any files in the
repo. Verify this: run `make check`, then confirm `git status` is clean.
5. The README's make-target list mentions the new target.
6. `make check` fully green.
7. `TODO.md` updated in the same commit.
8. Commit title ends with ` (closes #N)`.
## Implementation requirements
- Follow the existing Makefile's conventions: `$(GO_PKGS)`, the `.PHONY`
line, and a short comment above the target like its neighbors.
- Do NOT add a Dockerfile, CI config, or `script/` entrypoints — this repo is
exempt.
- Do NOT modify `.golangci.yml`.
- No Go source changes; this is build tooling only.
- `make` targets only for verification.
- Never mention Claude or Anthropic anywhere.
## Priority
Low — this is a tooling convenience. It is genuinely more valuable **before**
the four coverage issues than after, since it turns "did we actually improve
coverage?" into a measurable question, but it does not block them.
make cover writes build/coverage.out and prints the per-function report. make cover-html depends on cover and renders the same profile to build/coverage.html, echoing the path — a target rather than a README one-liner, since the one-liner would have been a raw go tool cover invocation in the docs.
Both use $(GO_PKGS) and the existing .PHONY line, and both are out of check: they write files, and check must not modify the working tree. The check recipe now says so in a comment. Coverage artifacts land under build/, which .gitignore covers as a whole.
README.md's make-target list names both, and points at build/coverage.html.
TODO.md has a Completed Steps entry in the same commit.
Verification, make targets only:
GOFLAGS=-count=1 make cover-html printed per-function lines and total: (statements) 62.6%, then wrote build/coverage.html. Sample of what the per-function view gives that make test's per-package percentage cannot: game/weapons.go:109: wield 0.0%, term/tcell.go:94: ReadChar 0.0%.
git status --porcelain empty with build/coverage.out, build/coverage.html and build/rogue all present.
GOFLAGS=-count=1 make check green in 22.5s, check still fmt-check lint test. The lint layer reported DONE 13.2s with 0 issues., not CACHED; test lines cmd/rogue 1.075s and game 4.049s, no (cached) marker. git status --porcelain empty afterwards.
make cover runs without -race deliberately — coverage is a measurement, not the gate, and make test is where the race detector runs.
Done in `e3ab4ab` on `next`, in https://git.eeqj.de/sneak/rgoue/pulls/46.
`make cover` writes `build/coverage.out` and prints the per-function report. `make cover-html` depends on `cover` and renders the same profile to `build/coverage.html`, echoing the path — a target rather than a README one-liner, since the one-liner would have been a raw `go tool cover` invocation in the docs.
Both use `$(GO_PKGS)` and the existing `.PHONY` line, and both are out of `check`: they write files, and `check` must not modify the working tree. The `check` recipe now says so in a comment. Coverage artifacts land under `build/`, which `.gitignore` covers as a whole.
`README.md`'s make-target list names both, and points at `build/coverage.html`.
`TODO.md` has a Completed Steps entry in the same commit.
Verification, `make` targets only:
- `GOFLAGS=-count=1 make cover-html` printed per-function lines and `total: (statements) 62.6%`, then `wrote build/coverage.html`. Sample of what the per-function view gives that `make test`'s per-package percentage cannot: `game/weapons.go:109: wield 0.0%`, `term/tcell.go:94: ReadChar 0.0%`.
- `git status --porcelain` empty with `build/coverage.out`, `build/coverage.html` and `build/rogue` all present.
- `GOFLAGS=-count=1 make check` green in 22.5s, `check` still `fmt-check lint test`. The lint layer reported `DONE 13.2s` with `0 issues.`, not `CACHED`; test lines `cmd/rogue 1.075s` and `game 4.049s`, no `(cached)` marker. `git status --porcelain` empty afterwards.
`make cover` runs without `-race` deliberately — coverage is a measurement, not the gate, and `make test` is where the race detector runs.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Coverage is currently unmeasurable without violating repo policy. Only
maketargets and
script/entrypoints may be used, and no target reports coveragedetail — so "which functions are untested?" can only be answered by grepping
test files for identifiers by hand.
That is exactly how the current coverage gaps (#5 rings, #6 sticks, #7 wizard,
#14 traps) had to be found, and it is slow and error-prone.
Note #2 adds
-covertomake test, which prints a single per-packagepercentage. That is a coarse signal — useful as a trend, useless for finding
which function is uncovered. This issue is about the per-function view.
Definition of done
make covertarget that produces a per-function coverage report(the
-coverprofile+go tool cover -funcshape), so specific untestedfunctions are identifiable.
target (
make cover-html) or a documented one-liner in the README..gitignoreis updated so a stray profile can never be committed.
make checkmust not runmake coverand must remain non-file-modifying — policy requires
make checknot to modify any files in therepo. Verify this: run
make check, then confirmgit statusis clean.make checkfully green.TODO.mdupdated in the same commit.(closes #N).Implementation requirements
$(GO_PKGS), the.PHONYline, and a short comment above the target like its neighbors.
script/entrypoints — this repo isexempt.
.golangci.yml.maketargets only for verification.Priority
Low — this is a tooling convenience. It is genuinely more valuable before
the four coverage issues than after, since it turns "did we actually improve
coverage?" into a measurable question, but it does not block them.
Done in
e3ab4abonnext, in #46.make coverwritesbuild/coverage.outand prints the per-function report.make cover-htmldepends oncoverand renders the same profile tobuild/coverage.html, echoing the path — a target rather than a README one-liner, since the one-liner would have been a rawgo tool coverinvocation in the docs.Both use
$(GO_PKGS)and the existing.PHONYline, and both are out ofcheck: they write files, andcheckmust not modify the working tree. Thecheckrecipe now says so in a comment. Coverage artifacts land underbuild/, which.gitignorecovers as a whole.README.md's make-target list names both, and points atbuild/coverage.html.TODO.mdhas a Completed Steps entry in the same commit.Verification,
maketargets only:GOFLAGS=-count=1 make cover-htmlprinted per-function lines andtotal: (statements) 62.6%, thenwrote build/coverage.html. Sample of what the per-function view gives thatmake test's per-package percentage cannot:game/weapons.go:109: wield 0.0%,term/tcell.go:94: ReadChar 0.0%.git status --porcelainempty withbuild/coverage.out,build/coverage.htmlandbuild/rogueall present.GOFLAGS=-count=1 make checkgreen in 22.5s,checkstillfmt-check lint test. The lint layer reportedDONE 13.2swith0 issues., notCACHED; test linescmd/rogue 1.075sandgame 4.049s, no(cached)marker.git status --porcelainempty afterwards.make coverruns without-racedeliberately — coverage is a measurement, not the gate, andmake testis where the race detector runs.