Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // A default type rewrite map DefaultTypeRewrite = map[string]string{ "feature": "feat", "bug": "fix", "task": "feat", "story": "feat", } )
Functions ¶
func AllCommitType ¶
func AllCommitType() []string
func ColorizeCommitType ¶
func ColorizeCommitType(s string, ct CommitType) string
func CommitMessage ¶
func CommitMessage(o *CommitMessageOption) string
Format commit message according to https://www.conventionalcommits.org/en/v1.0.0/
Types ¶
type CommitMessageOption ¶
type CommitMessageOption struct {
// Commit type (optional)
Ctype CommitType
// Commit scope (optional)
Scope string
// Commit subject (required)
Description string
// Commit body (optional)
Body string
Footers []string
// Breaking change flag (optional)
BreakingChanges bool
}
func ParseCommitMsg ¶
func ParseCommitMsg(msg string) *CommitMessageOption
func (*CommitMessageOption) Check ¶
func (cmo *CommitMessageOption) Check() error
Check CommitMessageOption compliance
func (*CommitMessageOption) Overwrite ¶
func (cmo *CommitMessageOption) Overwrite(other *CommitMessageOption) error
Overwrite values with another CommitMessageOption.
type CommitType ¶
type CommitType int
const ( NilCommit CommitType = iota BuildCommit CiCommit ChoreCommit DocCommit FeatureCommit FixCommit PerfCommit RefactorCommit StyleCommit TestCommit )
func (CommitType) String ¶
func (b CommitType) String() string
type TugBranch ¶
type TugBranch struct {
// Branch type (e.g. 'feat', 'fix', 'user', etc...)
Type string
// Branch prefix (issue id, user name, etc...)
Prefix string
// Branch description
Description string
}
TugBranch represents a turbogit branch
func ParseBranch ¶
ParseBranch parses a given string into a TugBranch or return an error on bad format.
Click to show internal directories.
Click to hide internal directories.