Documentation ¶
Index ¶
- Variables
- type ConventionalCommit
- func (v *ConventionalCommit) Compare(other *ConventionalCommit) int
- func (v *ConventionalCommit) Equal(o *ConventionalCommit) bool
- func (v *ConventionalCommit) GreaterThan(o *ConventionalCommit) bool
- func (v *ConventionalCommit) GreaterThanOrEqual(o *ConventionalCommit) bool
- func (v *ConventionalCommit) LessThan(o *ConventionalCommit) bool
- func (v *ConventionalCommit) LessThanOrEqual(o *ConventionalCommit) bool
- type ConventionalCommits
Constants ¶
This section is empty.
Variables ¶
var ( // PatchCategories is the list of categories used to determine if this commit is a patch bump or not PatchCategories = []string{ "fix", "refactor", "perf", "docs", "style", "bug", "test", } // MinorCategories is the list of categories used to determine if this commit is a minor bump or not MinorCategories = []string{ "feat", "feature", "story", } // MajorCategories is the list of categories used to determine if this commit is a major bump or not MajorCategories = []string{ "breaking", } )
Functions ¶
This section is empty.
Types ¶
type ConventionalCommit ¶
type ConventionalCommit struct { Category string `yaml:"category"` Scope string `yaml:"scope"` Description string `yaml:"description"` Body string `yaml:"body"` Major bool `yaml:"major"` Minor bool `yaml:"minor"` Patch bool `yaml:"patch"` }
ConventionalCommit a parsed conventional commit message
func ParseConventionalCommit ¶
func ParseConventionalCommit(message string) (commit *ConventionalCommit)
ParseConventionalCommit takes a commits message and parses it into usable blocks
func (*ConventionalCommit) Compare ¶
func (v *ConventionalCommit) Compare(other *ConventionalCommit) int
Compare compares this version to another version. This returns -1, 0, or 1 if this version is smaller, equal, or larger than the other version, respectively.
If you want boolean results, use the LessThan, Equal, GreaterThan, GreaterThanOrEqual or LessThanOrEqual methods.
func (*ConventionalCommit) Equal ¶
func (v *ConventionalCommit) Equal(o *ConventionalCommit) bool
Equal tests if two versions are equal.
func (*ConventionalCommit) GreaterThan ¶
func (v *ConventionalCommit) GreaterThan(o *ConventionalCommit) bool
GreaterThan tests if this version is greater than another version.
func (*ConventionalCommit) GreaterThanOrEqual ¶
func (v *ConventionalCommit) GreaterThanOrEqual(o *ConventionalCommit) bool
GreaterThanOrEqual tests if this version is greater than or equal to another version.
func (*ConventionalCommit) LessThan ¶
func (v *ConventionalCommit) LessThan(o *ConventionalCommit) bool
LessThan tests if this version is less than another version.
func (*ConventionalCommit) LessThanOrEqual ¶
func (v *ConventionalCommit) LessThanOrEqual(o *ConventionalCommit) bool
LessThanOrEqual tests if this version is less than or equal to another version.
type ConventionalCommits ¶
type ConventionalCommits []*ConventionalCommit
ConventionalCommits a slice of parsed conventional commit messages
func ParseConventionalCommits ¶
func ParseConventionalCommits(messages []string) (commits ConventionalCommits)
func (ConventionalCommits) Len ¶
func (v ConventionalCommits) Len() int
Len return the number of messages in the slice required to implement sortable interface https://golang.org/pkg/sort/#Interface
func (ConventionalCommits) Less ¶
func (v ConventionalCommits) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j. required to implement sortable interface https://golang.org/pkg/sort/#Interface
func (ConventionalCommits) Swap ¶
func (v ConventionalCommits) Swap(i, j int)
Swap swaps the elements with indexes i and j. required to implement sortable interface https://golang.org/pkg/sort/#Interface