feat: add formatting helper APIs#3
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 137 153 +16
=========================================
+ Hits 137 153 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds GoLand-recognizable *f formatting helper siblings to the stacktrace public API, while aiming to preserve existing behavior around caller attribution (runtime.Caller(2)), nil propagation, and error-code semantics.
Changes:
- Added five new exported helper functions:
NewErrorf,Propagatef,NewErrorWithCodef,PropagateWithCodef,NewMessageWithCodef. - Added black-box tests to validate formatting output, code inheritance/override, nil propagation, and caller attribution for the new helpers.
- Updated README examples/signatures to use the
*fhelpers for interpolated messages, and added design/plan docs describing the API intent.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| stacktrace.go | Adds the new *f formatting helper APIs alongside existing constructors/wrappers. |
| stacktrace_test.go | Adds coverage for formatting helpers’ output, code behavior, nil propagation, and caller capture. |
| functions_for_test.go | Adds call-site fixtures used to validate caller attribution in tests. |
| README.md | Documents *f helpers and updates interpolated examples/signatures. |
| docs/superpowers/specs/2026-07-19-formatting-helper-api-design.md | Design spec for the formatting helper API addition. |
| docs/superpowers/plans/2026-07-19-formatting-helper-api.md | Implementation plan documenting steps/tests for the change. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
README.md:146
- The
%wunsupported-behavior caveat is currently in a[!NOTE]block, but it's an important behavioral difference fromfmt.Errorfthat can easily surprise users. Consider using[!IMPORTANT]here (consistent with other high-signal caveats in this README).
> [!NOTE]
> Unlike `fmt.Errorf`, `%w` is not supported; use `Propagate` or `Propagatef` to
> wrap a cause.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation