Documentation
¶
Index ¶
- Constants
- Variables
- func DeduplicateEntries(entries []string) []string
- func FixSectionHeadings(unreleasedSection []string)
- func InsertChangelogEntry(content string, entries []string) string
- func MakeNewSections(sections map[string]*[]string, nextVersion semver.Version) []string
- func MakeNewSectionsFromUnreleased(unreleasedSection []string, version semver.Version) []string
- func ParseUnreleasedIntoSections(unreleasedSection []string, sections map[string]*[]string, ...)
- func ReclassifyEntriesByVerb(sections map[string]*[]string)
- func UpdateSection(unreleasedSection []string, nextVersion semver.Version) ([]string, *semver.Version, error)
- type Changelog
Constants ¶
const InitialReleaseVersion = "0.1.0"
InitialReleaseVersion is the version used when no previous release version is present in the changelog.
Variables ¶
var ( ErrNoVersionFoundInChangelog = errors.New("no version found in the changelog") ErrNoChangesFoundInUnreleased = errors.New("no changes found in the unreleased section") )
Functions ¶
func DeduplicateEntries ¶
DeduplicateEntries removes duplicate and semantically overlapping changelog entries.
func FixSectionHeadings ¶
func FixSectionHeadings(unreleasedSection []string)
FixSectionHeadings fixes the section headings in the unreleased section.
func InsertChangelogEntry ¶
InsertChangelogEntry inserts one or more bullet entries into the "## [Unreleased]" / "### Changed" section of a Keep-a-Changelog formatted string.
func MakeNewSections ¶
MakeNewSections creates new section contents for the beginning of the CHANGELOG file.
func MakeNewSectionsFromUnreleased ¶
MakeNewSectionsFromUnreleased creates new section contents for initial release.
func ParseUnreleasedIntoSections ¶
func ParseUnreleasedIntoSections( unreleasedSection []string, sections map[string]*[]string, currentSection *[]string, majorChanges, minorChanges, patchChanges *int, )
ParseUnreleasedIntoSections parses the unreleased section into change type sections.
func ReclassifyEntriesByVerb ¶ added in v0.5.0
ReclassifyEntriesByVerb moves entries to the correct section based on their leading verb. For example, an entry "- removed old feature" under "### Changed" is moved to "### Removed".
Types ¶
type Changelog ¶
type Changelog struct {
// contains filtered or unexported fields
}
Changelog encapsulates a Keep-a-Changelog formatted document as lines.
func NewChangelog ¶
NewChangelog creates a new Changelog from the given lines.
func (*Changelog) FindLatestVersion ¶
FindLatestVersion finds the latest version in the changelog lines.
func (*Changelog) IsUnreleasedEmpty ¶
IsUnreleasedEmpty checks whether the unreleased section of the changelog is empty.