Documentation
¶
Overview ¶
Package changelog keeps a Keep a Changelog file's Unreleased section to the changes no release carries yet.
Auto Release tags a release from every releasable merge, and the entry the merged pull request added under Unreleased is part of that release: the CHANGELOG.md of the tag lists it under Unreleased. Cut moves every such entry into the section of the release that first carried it; Check lists them.
Only Unreleased and the sections receiving entries are rewritten: every other section, the preamble and the link references keep their bytes.
Index ¶
Constants ¶
const Unreleased = "Unreleased"
Unreleased is the name of the section holding the changes no release carries.
Variables ¶
This section is empty.
Functions ¶
func HasUnreleased ¶
HasUnreleased reports whether text has an Unreleased section to cut.
func IsExecutionFailed ¶
IsExecutionFailed asserts executionFailedError.
Types ¶
type Moved ¶
type Moved struct {
// Release is the tag of the release that carried the entry first.
Release string
// Entry is the entry's text, its bullet line and the lines continuing it.
Entry string
}
Moved is an entry Cut moved out of Unreleased.
func Cut ¶
Cut moves every Unreleased entry a release already carried into that release's section, creating the section (and its link reference, when the file keeps them) where it is missing, and returns the new text and the moved entries. A text without an Unreleased section is returned unchanged. An entry added again after a release carried it once stays: a release is credited only with the copies its CHANGELOG.md holds beyond the previous release's.
type Release ¶
type Release struct {
// Version is the release's version without the tag's "v".
Version *semver.Version
// Tag is the tag the release is named by.
Tag string
// Date is the tagged commit's date, YYYY-MM-DD.
Date string
// Changelog is the CHANGELOG.md at the tag; empty when the tag has none.
Changelog string
}
Release is one release as cut: the tags on one commit are one release, named by the highest version among them (a promoted release candidate by its final version).