changes

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypesInOrder = Types{
	"feat",
	"fix",
	"test",
	"docs",
	"build",
	"refactor",
	"chore",
}

TypesInOrder is the standard ordering of types

Functions

func AlwaysStop added in v0.4.0

func AlwaysStop(_ *object.Commit) bool

AlwaysStop is an StopAt that accepts every commit

func NeverStop added in v0.4.0

func NeverStop(_ *object.Commit) bool

NeverStop is an StopAt that accepts nothing, ever

Types

type ChangeSet

type ChangeSet struct {
	BreakingChanges []string
	Commits         map[TypeTag][]string
}

ChangeSet represents the list of all changes in a commit stream (presumably from a base tag)

func Load

func Load(r *repo.Repository, stopAt StopAt, guess CommitTypeGuesser) (*ChangeSet, error)

Load creates a new CommitSet from a repository

func NewChangeSet

func NewChangeSet() *ChangeSet

NewChangeSet creates a new, empty change set

type CommitTypeEntry

type CommitTypeEntry struct {
	Name     string
	Tag      TypeTag
	Order    int
	Messages []string
}

CommitTypeEntry represents a list of messages of a specific type

func CommitEntries

func CommitEntries(order []TypeTag, m map[TypeTag][]string) []CommitTypeEntry

CommitEntries returns a list of CommitTypeEntry

type CommitTypeGuesser

type CommitTypeGuesser func(commit *object.Commit) TypeTag

CommitTypeGuesser is a guess function to guess commit type from the commit. StandardGuess can be used as a base to fill this in.

func DefaultGuess

func DefaultGuess(tag TypeTag) CommitTypeGuesser

DefaultGuess just returns the specified tag if it has to guess

type StopAt added in v0.4.0

type StopAt func(commit *object.Commit) bool

StopAt is a commit recognizer

func StopAtCount added in v0.4.0

func StopAtCount(count int) StopAt

StopAtCount accepts the specific count of commits given

func StopAtFirstSemver added in v0.4.0

func StopAtFirstSemver(r *repo.Repository) StopAt

func StopAtHash added in v0.4.0

func StopAtHash(hash plumbing.Hash) StopAt

StopAtHash stops when the hash is encountered

func StopAtTagMatch added in v0.4.0

func StopAtTagMatch(r *repo.Repository, matchString func(s string) bool) StopAt

StopAtTagMatch stops when the tag matches a tag referring to this commit

type TypeTag

type TypeTag string

TypeTag represents the type of a commit. There is a pre-defined set, but it can also be dynamically extended.

var NoClue TypeTag = "--no clue--"

func StandardGuess

func StandardGuess(commit *object.Commit) (TypeTag, error)

StandardGuess guesses the commit type by examining the commit

type Types

type Types []TypeTag

Types is a list of TypeTag

func (Types) Join

func (t Types) Join(sep string) string

Join joins the specified Types using the given separator

Jump to

Keyboard shortcuts

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