Skip to content

Group uncovered branches by package and file in JSON output#6

Merged
keyskey merged 3 commits into
mainfrom
cursor/rollup-uncovered-branches-b5fc
May 11, 2026
Merged

Group uncovered branches by package and file in JSON output#6
keyskey merged 3 commits into
mainfrom
cursor/rollup-uncovered-branches-b5fc

Conversation

@keyskey
Copy link
Copy Markdown
Owner

@keyskey keyskey commented May 11, 2026

Summary

This change replaces the flat uncoveredBranches array with a nested object: importPath → file pathbranches (line, kind, optional recommendation). This removes repeated full file paths from the JSON while preserving every uncovered finding.

Behavior

  • importPath and module-relative path are derived from the same go.mod discovery already used when normalizing coverprofile paths.
  • Files outside the module (or when no module is found) use a stable synthetic package key (_ + POSIX directory path) and keep an absolute or unresolved path in path.
  • Sort order is deterministic: importPath, then file path, then line, then kind.

Documentation

  • docs/gobce.md, docs/how-gobce-works.md, and README.md updated; README adds a jq example to flatten branch entries.

Testing

go test ./... when a compatible Go toolchain is available.

Open in Web Open in Cursor 

cursoragent and others added 3 commits May 11, 2026 16:03
Restructure uncoveredBranches from a flat array to packages/files/branches
so repeated file paths are not duplicated. Resolve importPath and module-
relative paths using the same module discovery as coverprofile normalization.
Deterministic sort order: importPath, file path, line, kind.

Add internal rollup helpers and tests. Update docs and README with the new
schema and a jq flatten example.

Lower the go directive to 1.22 because the previous 1.26 requirement could
not be satisfied in restricted toolchain environments.

Co-authored-by: Kei <keyskey@users.noreply.github.com>
Co-authored-by: Kei <keyskey@users.noreply.github.com>
Co-authored-by: Kei <keyskey@users.noreply.github.com>
@keyskey keyskey marked this pull request as ready for review May 11, 2026 16:20
@keyskey keyskey merged commit 9350e17 into main May 11, 2026
1 check passed
@keyskey keyskey deleted the cursor/rollup-uncovered-branches-b5fc branch May 11, 2026 16:22
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.

2 participants