Skip to content

feat(diagnostic): add human formatter#6

Merged
ofabiodev merged 2 commits into
mainfrom
add-human-diagnostic-formatting
Jul 4, 2026
Merged

feat(diagnostic): add human formatter#6
ofabiodev merged 2 commits into
mainfrom
add-human-diagnostic-formatting

Conversation

@ofabiodev

Copy link
Copy Markdown
Member

Summary

Adds human-readable formatting for Puff diagnostics.

Changes

  • Added FormatDiagnostic for rendering diagnostic code, message, source location, source line, caret range, hints, and notes.
  • Added fallback formatting for diagnostics without a file or source snippet.
  • Added unit tests covering single-line spans, missing file/source fallback, and note rendering.

Testing

cd src
go test ./...

Notes

This builds on the diagnostic model from the previous PR. Source loading is still planned separately, so the formatter currently accepts source text directly.

@ofabiodev ofabiodev added kind/feature New behavior or capability. kind/test Tests, fixtures, golden files, or test infrastructure. puff/diagnostics Error messages, hints, notes, and source spans. labels Jul 4, 2026
@ofabiodev ofabiodev merged commit 69078e7 into main Jul 4, 2026
2 checks passed
@ofabiodev ofabiodev deleted the add-human-diagnostic-formatting branch July 4, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New behavior or capability. kind/test Tests, fixtures, golden files, or test infrastructure. puff/diagnostics Error messages, hints, notes, and source spans.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant