chore(go): use vociferate for unreleased parsing

This commit is contained in:
Micheal Wilkinson
2026-03-21 14:25:27 +00:00
parent b7d1760beb
commit e625d475a5
3 changed files with 36 additions and 17 deletions

View File

@@ -209,6 +209,12 @@ func RecommendedTag(rootDir string, options Options) (string, error) {
return defaultService().RecommendedTag(rootDir, options)
}
// UnreleasedBody returns the current Unreleased changelog body exactly as it
// should appear in downstream tooling.
func UnreleasedBody(rootDir string, options Options) (string, error) {
return defaultService().UnreleasedBody(rootDir, options)
}
// RecommendedTag returns the next semantic release tag based on current changelog state.
func (s *Service) RecommendedTag(rootDir string, options Options) (string, error) {
resolved, err := resolveOptions(options)
@@ -265,6 +271,16 @@ func (s *Service) RecommendedTag(rootDir string, options Options) (string, error
return fmt.Sprintf("v%d.%d.%d", parsed.major, parsed.minor, parsed.patch), nil
}
// UnreleasedBody returns the current Unreleased changelog body.
func (s *Service) UnreleasedBody(rootDir string, options Options) (string, error) {
resolved, err := resolveOptions(options)
if err != nil {
return "", err
}
return s.readUnreleasedBody(rootDir, resolved.Changelog)
}
func sectionHasEntries(unreleasedBody, sectionName string) bool {
heading := "### " + sectionName
sectionStart := strings.Index(unreleasedBody, heading)