Skip to content

feat: add formatting helper APIs#3

Merged
AchoArnold merged 7 commits into
mainfrom
feat/formatting-helper-api
Jul 19, 2026
Merged

feat: add formatting helper APIs#3
AchoArnold merged 7 commits into
mainfrom
feat/formatting-helper-api

Conversation

@AchoArnold

Copy link
Copy Markdown
Member

Summary

  • add GoLand-recognizable formatting siblings for all formatting APIs
  • preserve existing API behavior, caller attribution, nil propagation, and error codes
  • document static versus interpolated helper usage

Validation

  • go test -cover ./...
  • go vet ./...
  • golangci-lint fmt --diff
  • golangci-lint run
  • pre-commit run --all-files

AchoArnold and others added 5 commits July 19, 2026 15:25
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

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (209fcdb) to head (c8eab77).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 *f helpers 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.

Comment thread stacktrace.go Outdated
Comment thread stacktrace.go Outdated
Comment thread stacktrace.go Outdated
Comment thread README.md Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 %w unsupported-behavior caveat is currently in a [!NOTE] block, but it's an important behavioral difference from fmt.Errorf that 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.

Comment thread stacktrace.go Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1601a53e-b461-4419-af08-50a1839599b5
@AchoArnold
AchoArnold merged commit 3fe6744 into main Jul 19, 2026
24 checks passed
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