changelog

package
v0.0.0-...-3a64406 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeEnhancement = EntryType("enhancement")
	TypeBugfix      = EntryType("bugfix")
	TypeSecurity    = EntryType("security")
	TypeBreaking    = EntryType("breaking")
	// TypeDependency is the entry bump for a dependency bump. It is better, however, to encode dependency changes in
	// Changelog.Dependencies rather than Changelog.Changes as that allows for smarter semver bumping and richer format.
	TypeDependency = EntryType("dependency")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Changelog

type Changelog struct {
	// Held is true if this changelog should not be released without human intervention.
	Held bool `yaml:"held,omitempty"`
	// Notes is a markdown snippet that will be rendered just below the version header.
	Notes string `yaml:"notes"`
	// Changes is a list of changes that have been made since the last release.
	// They have a description and a bump.Type, and may optionally include metadata about the author, PR, or commit when
	// they were introduced.
	Changes []Entry `yaml:"changes"`
	// Dependencies is a list of the dependencies that have been bumped, optionally including info about from which
	// to which version they were.
	Dependencies []Dependency `yaml:"dependencies"`
}

Changelog models a machine-readable changelog.

func (*Changelog) Empty

func (c *Changelog) Empty() bool

Empty returns true if this changelog contains no data.

func (*Changelog) Merge

func (c *Changelog) Merge(other *Changelog)

Merge appends changes noted in other changelog to the current one.

type Dependency

type Dependency struct {
	Name string          `yaml:"name"`
	From *semver.Version `yaml:"from,omitempty"`
	To   *semver.Version `yaml:"to,omitempty"`
	// Link to the changelog for the release of this dependency.
	Changelog string    `yaml:"changelog"`
	Meta      EntryMeta `yaml:"meta,omitempty"`
}

Dependency models a dependency that has been changed in the project.

func (Dependency) BumpType

func (d Dependency) BumpType() bump.Type

BumpType returns which version should be bumped due to this dependency update. In practice, this is the same as the bump the dependency had.

func (Dependency) Change

func (d Dependency) Change() string

func (Dependency) MarshalYAML

func (d Dependency) MarshalYAML() (interface{}, error)

MarshalYAML copies the contents of Dependency to a plainDependency and returns it for the generic marshaler to encode it.

func (Dependency) String

func (d Dependency) String() string

Strings outputs a human-readable one-liner of the dependency update, including extra information if found.

func (*Dependency) UnmarshalYAML

func (d *Dependency) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML decodes the node into a plainDependency and copies it over to the real Dependency.

type Entry

type Entry struct {
	// Type holds which bump this change was: A bug fix, a new feature, etc. See EntryType.
	Type EntryType `yaml:"type"`
	// Message is a human-readable one-liner summarizing the change.
	Message string `yaml:"message"`
	// Meta holds information about who made the change and where.
	Meta EntryMeta `yaml:"meta,omitempty"`
}

Entry is a representation of a change that has been made in the code.

func (Entry) BumpType

func (e Entry) BumpType() bump.Type

BumpType returns which version should be bumped due to this change.

func (Entry) String

func (e Entry) String() string

Strings outputs a human-readable one-liner of the change, including meta information if found.

type EntryMeta

type EntryMeta struct {
	Author string `yaml:"author,omitempty"`
	PR     string `yaml:"pr,omitempty"`
	Commit string `yaml:"commit,omitempty"`
}

EntryMeta holds information about who made the change and where.

type EntryType

type EntryType string

EntryType encodes the nature of the change.

type Source

type Source interface {
	Changelog() (*Changelog, error)
}

type Version

type Version *semver.Version

Directories

Path Synopsis
Package linker implements linking dependency changelogs when they get updated.
Package linker implements linking dependency changelogs when they get updated.
sources
markdown
Package markdown implements sourcing unreleased entries from https://keepachangelog.com/en/1.0.0/
Package markdown implements sourcing unreleased entries from https://keepachangelog.com/en/1.0.0/
markdown/merger
Package merger contains the Merger object, which incorporates a changelog.Changelog into a full markdown changelog.
Package merger contains the Merger object, which incorporates a changelog.Changelog into a full markdown changelog.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL