refactor(diff): move rendering to output layer - #82
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughThe diff CLI now delegates text and JSON rendering to ChangesDiff output migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6312393ee6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Moves vaar diff rendering responsibilities into the output layer (internal/output/diff) and completes removal of the obsolete internal/report facade, keeping CLI orchestration focused on IO/flags/exit codes while typed renderers own formatting.
Changes:
- Added
internal/output/difftext + JSON renderers fordiff.Result(including empty-array normalization for JSON). - Updated
internal/cli/diff.goto delegate rendering tointernal/output/diff. - Removed the
internal/reportcompatibility package and its tests; updatedinternal/outputpackage documentation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/report/text.go | Removed obsolete forwarding facade (lint text). |
| internal/report/json.go | Removed obsolete forwarding facade (lint JSON). |
| internal/report/report_test.go | Removed tests for the deleted internal/report facade. |
| internal/output/doc.go | Clarified output-layer scope (command-specific subpackages like lint/diff). |
| internal/output/diff/diff.go | New diff text/JSON renderers and JSON empty-array normalization. |
| internal/output/diff/diff_test.go | Added exact-output tests for diff text/JSON rendering behavior. |
| internal/cli/diff.go | CLI now delegates diff rendering to internal/output/diff. |
| internal/cli/diff_test.go | Added import-direction guard test and updated JSON payload type in tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Move
vaar difftext and JSON rendering intointernal/output/diffand remove the obsoleteinternal/reportcompatibility facade.Why
This completes the existing diff output migration described in Discussion #58 and keeps CLI orchestration separate from typed output rendering.
Closes #71.
Type
Breaking change
Changes
internal/output/diff.internal/cli.internal/reportcompatibility facade.User-visible changes
None. Existing diff output, JSON schema, quiet mode, exit codes, and error behavior are unchanged.
Validation
Commands run:
gofmt -w <touched Go files>make lintgo test ./...go run ./cmd/vaar lint ...Additional commands:
Tests
Documentation
Release notes
Moved diff text and JSON rendering into the layered output package and removed the obsolete report facade.
Reviewer notes
Please pay special attention to:
null.--quiet, exit codes, and operational errors.internal/report.internal/output/diff.Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Tests