-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededreporting
Description
Make report formatters handle nil Changes
Context
I hit a panic when calling the report formatters with a Result that didn’t populate Changes (early exit case). The CLI swallowed it, but a direct library call crashes.
Problem
FormatJSON, FormatHTML, and FormatText assume result.Changes is non-nil and dereference it unconditionally.
Expected behavior
Passing a Result with a nil Changes should return a valid string without panicking, treating missing changes as empty.
Scope / non-goals
- Don’t alter the output shape when
Changesis present; only guard the nil case. - No formatter redesigns.
Acceptance criteria
- All three formatters return without panic when
Changesis nil. - Existing formatter snapshots stay identical when
Changesis set. - Tests cover the nil-
Changesscenario for JSON, HTML, and text outputs.
Hints
internal/report/json.go,html.go,text.goand their tests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededreporting