Skip to content

refactor: golden file render tests for changelog - #82

Merged
mroth merged 1 commit into
mainfrom
refactor-changelog
Jul 23, 2025
Merged

mroth merged 1 commit into
mainfrom
refactor-changelog

Conversation

@mroth

@mroth mroth commented Jul 23, 2025

Copy link
Copy Markdown
Owner

This should make any future UX refactoring easier. Also cleans up changelog render code a tiny bit while I'm in there.

also cleanup changelog render code
@mroth
mroth requested a review from Copilot July 23, 2025 14:28

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

This PR refactors the changelog rendering functionality by extracting it into a separate module with golden file tests. The changes improve code organization and add comprehensive test coverage for changelog rendering functions.

  • Moved changelog rendering functions from main.go to a dedicated changelog.go file
  • Added golden file tests for both screen and markdown changelog rendering
  • Cleaned up the changelog rendering implementation with better variable naming and use of strings.Builder

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
main.go Removed changelog functions and updated function calls to use new capitalized names
changelog.go New file containing refactored changelog rendering functions with improved implementation
changelog_test.go Added comprehensive golden file tests with sample commit data
go.mod Added google/go-cmp dependency for test comparisons
testdata/sample_screen.golden Golden file for screen changelog output format
testdata/sample_markdown.golden Golden file for markdown changelog output format

Comment thread changelog.go Resolved
@mroth
mroth merged commit f0d3f6c into main Jul 23, 2025
@mroth
mroth deleted the refactor-changelog branch July 23, 2025 14:32
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

⌂ 换网址