changes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 10 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

This section is empty.

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 *git.Repository, stopAt plumbing.Hash, 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 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