Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeadingFor ¶
func HeadingFor(ct ChangeType) string
HeadingFor returns a display label for each ChangeType.
Types ¶
type Change ¶
type Change struct {
Type ChangeType `toml:"type"`
Text string `toml:"text"`
}
Change is a single line item in a version entry.
func SortedChanges ¶
SortedChanges returns changes for an entry in canonical category order.
type ChangeType ¶
type ChangeType string
ChangeType classifies a single changelog entry.
const ( Added ChangeType = "added" Changed ChangeType = "changed" Fixed ChangeType = "fixed" Removed ChangeType = "removed" Deprecated ChangeType = "deprecated" Security ChangeType = "security" )
type Entry ¶
type Entry struct {
Version string `toml:"version"`
Date string `toml:"date"`
Changes []Change `toml:"changes"`
}
Entry is one version block in the changelog.
func Check ¶
Check returns (shouldWrite, toShow) given last-seen and current version strings and the full set of changelog entries.
Rules:
- lastSeen == "" (first run) -> shouldWrite=true, toShow=nil
- Any semver parse failure -> shouldWrite=true, toShow=nil (silent write)
- current > lastSeen -> shouldWrite=false, toShow=entries in (lastSeen, current] (most recent first)
- current <= lastSeen -> shouldWrite=false, toShow=nil
Click to show internal directories.
Click to hide internal directories.