Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AngularCommits ¶
type AngularCommits struct{}
AngularCommits implements the Angular commit convention. Angular format is the same as Conventional Commits: type(scope): description. The key difference is the type-to-bump mapping.
func (*AngularCommits) Parse ¶
func (a *AngularCommits) Parse(subject, body string) *ParsedCommit
type Convention ¶
type Convention interface {
Parse(subject, body string) *ParsedCommit
}
Convention parses commit messages according to a specific convention.
func Freeform ¶ added in v0.2.0
func Freeform() Convention
Freeform returns a Convention that accepts all commits as patch bumps.
func ResolveConvention ¶ added in v0.1.0
func ResolveConvention(convention string, major, minor, patch []string) Convention
ResolveConvention returns the Convention implementation for the given convention name and optional custom type-to-bump mappings.
type ConventionalCommits ¶
type ConventionalCommits struct{}
ConventionalCommits implements the Conventional Commits convention.
func (*ConventionalCommits) Parse ¶
func (c *ConventionalCommits) Parse(subject, body string) *ParsedCommit
type CustomCommits ¶
type CustomCommits struct {
MajorTypes map[string]bool
MinorTypes map[string]bool
PatchTypes map[string]bool
}
CustomCommits implements a user-defined commit convention.
func NewCustomCommits ¶
func NewCustomCommits(major, minor, patch []string) *CustomCommits
NewCustomCommits creates a CustomCommits convention from type lists.
func (*CustomCommits) Parse ¶
func (c *CustomCommits) Parse(subject, body string) *ParsedCommit
type ParsedCommit ¶
type ParsedCommit struct {
Hash string // full commit hash, carried from RawCommit
Type string // e.g., "feat", "fix"
Scope string // e.g., "auth", "cli"
Subject string // the description after type(scope):
Body string
Breaking bool
Bump version.BumpType
}
ParsedCommit holds the result of parsing a single commit message.
func Analyze ¶
func Analyze(commits []RawCommit, conv Convention) ([]ParsedCommit, *version.BumpType)
Analyze parses commits and returns the highest bump type. Returns nil bump type if no releasable changes are found.