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 ( // PatchTypes is the list of categories used to determine if this commit is a patch bump or not. PatchTypes = []string{ "fix", "refactor", "perf", "docs", "style", "bug", "test", } // MinorTypes is the list of categories used to determine if this commit is a minor bump or not. MinorTypes = []string{ "feat", "feature", "story", } // MajorTypes is the list of categories used to determine if this commit is a major bump or not. MajorTypes = []string{ "breaking", } )
Functions ¶
This section is empty.
Types ¶
type ConventionalCommit ¶
type ConventionalCommit struct { Raw string `yaml:"raw"` Type string `yaml:"category"` Scope string `yaml:"scope"` Subject string `yaml:"subject"` Header string `yaml:"header"` Body string `yaml:"body"` Major bool `yaml:"major"` Minor bool `yaml:"minor"` Patch bool `yaml:"patch"` Fixup bool `yaml:"fixup"` }
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