semrel

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package semrel processes version control data using an analyser function, to produce data for a release note

Index

Constants

View Source
const (
	NoBump    BumpLevel = iota
	BumpPatch           = iota
	BumpMinor           = iota
	BumpMajor           = iota
)

BumpLevel values

Variables

This section is empty.

Functions

This section is empty.

Types

type BumpLevel

type BumpLevel int

BumpLevel of the release and/or individual commit

type ByTime

type ByTime []Commit

ByTime implements sort.Interface for []Commit based on Time().

func (ByTime) Len

func (a ByTime) Len() int

func (ByTime) Less

func (a ByTime) Less(i, j int) bool

func (ByTime) Swap

func (a ByTime) Swap(i, j int)

type Change

type Change interface {
	Category() string
	ExternalCategory() string
	BumpLevel() BumpLevel
	PreReleased() bool
	IsExternal() bool
}

Change captures ChangeAnalyzer results

type ChangeAnalyzer

type ChangeAnalyzer interface {
	Analyze(commit *Commit) ([]Change, error)
}

ChangeAnalyzer analyzes a commit message and returns 0 or more entries to release note

type Commit

type Commit struct {
	Msg         string
	SHA         string
	Time        time.Time
	PreReleased bool
	IsMerge     bool
}

Commit contains VCS commit data

type ReleaseData

type ReleaseData struct {
	CurrentVersion semver.Version
	NextVersion    semver.Version
	BumpLevel      BumpLevel
	Changes        map[string][]Change
	// Time of the commit being released
	Time time.Time
}

ReleaseData contains information for next release

func Release

func Release(input *VCSData, analyzer ChangeAnalyzer) (*ReleaseData, error)

Release processes the release data

type VCSData

type VCSData struct {
	CurrentVersion    semver.Version
	UnreleasedCommits []Commit
	// Time of the commit being released
	Time time.Time
}

VCSData contains data collected from version control system

Jump to

Keyboard shortcuts

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