Skip to content

Refactor CHANGELOG template to use printf for better formatting#152

Merged
nhorton merged 1 commit intomainfrom
claude/fix-release-workflow-syntax-R7Cph
Jan 24, 2026
Merged

Refactor CHANGELOG template to use printf for better formatting#152
nhorton merged 1 commit intomainfrom
claude/fix-release-workflow-syntax-R7Cph

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 24, 2026

Summary

Refactored the UNRELEASED_TEMPLATE variable in the create-release workflow to use printf instead of a multi-line string literal. This improves code consistency and maintainability.

Changes

  • Replaced multi-line string literal with printf command for constructing the CHANGELOG template
  • Uses %s\n\n format specifier to properly handle newlines and spacing between sections
  • Maintains identical output while improving readability and reducing potential whitespace issues

Implementation Details

The new approach using printf with explicit format specifiers is more robust for shell scripting as it:

  • Eliminates potential issues with trailing whitespace in multi-line strings
  • Makes the spacing between sections (double newlines) explicit and clear
  • Follows shell scripting best practices for string construction

The multi-line bash string for UNRELEASED_TEMPLATE had content
starting at column 0, which broke YAML literal block parsing.
Using printf to build the template keeps proper YAML indentation.
Copy link

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 CHANGELOG template generation in the create-release workflow from a multi-line string literal to a printf-based approach. The change improves code consistency and maintainability while producing identical output.

Changes:

  • Replaced multi-line string literal with printf command for constructing UNRELEASED_TEMPLATE
  • Uses explicit %s\n\n format specifiers to clearly define spacing between sections
  • Maintains identical output with improved readability and reduced whitespace ambiguity

@nhorton nhorton merged commit bf51786 into main Jan 24, 2026
10 checks passed
@nhorton nhorton deleted the claude/fix-release-workflow-syntax-R7Cph branch January 24, 2026 19:38
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.

3 participants