Skip to content

refactor: improve commitauthor templating #5858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged

refactor: improve commitauthor templating #5858

merged 1 commit into from
Jun 26, 2025

Conversation

caarlos0
Copy link
Member

small improvement in the commit author templating.

@caarlos0 caarlos0 requested a review from Copilot June 26, 2025 12:58
@caarlos0 caarlos0 self-assigned this Jun 26, 2025
@caarlos0 caarlos0 added the enhancement New feature or request label Jun 26, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 26, 2025
Copy link

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: 94e5814
Status: ✅  Deploy successful!
Preview URL: https://dc8c17c8.goreleaser.pages.dev
Branch Preview URL: https://commitauthor.goreleaser.pages.dev

View logs

Copy link
Contributor

@Copilot Copilot AI left a comment

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 commit author templating logic to simplify error handling and reduce code duplication.

  • Replaces individual field templating with a single ApplyAll function call
  • Adjusts the function comment to indicate a new CommitAuthor instance is returned
Comments suppressed due to low confidence (2)

internal/commitauthor/author.go:15

  • [nitpick] Consider clarifying the comment to indicate that the function applies templates to all fields and returns a fully templated CommitAuthor instance.
// Get templates the commit author and returns a new [config.CommitAuthor].

internal/commitauthor/author.go:34

  • [nitpick] Returning an empty CommitAuthor on error may discard useful partial templating information. Consider returning the partially templated object along with an error to aid in debugging.
		return config.CommitAuthor{}, err

Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@f39686b). Learn more about missing BASE report.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5858   +/-   ##
=======================================
  Coverage        ?   82.73%           
=======================================
  Files           ?      164           
  Lines           ?    16497           
  Branches        ?        0           
=======================================
  Hits            ?    13649           
  Misses          ?     2256           
  Partials        ?      592           

☔ View full report in Codecov by Sentry.
📢 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.

@caarlos0 caarlos0 merged commit f409252 into main Jun 26, 2025
16 of 17 checks passed
@caarlos0 caarlos0 deleted the commitauthor branch June 26, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant