format

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllBranchType

func AllBranchType() []string

func AllCommitType

func AllCommitType() []string

func BranchName

func BranchName(btype BranchType, description string, username string) string

func ColorizeCommitType added in v1.2.0

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 BranchType

type BranchType int
const (
	FeatureBranch BranchType = iota
	FixBranch
	UserBranch
)

func BranchTypeFrom

func BranchTypeFrom(str string) (BranchType, error)

func (BranchType) String

func (b BranchType) String() string

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
	// Commit footers (optional)
	Footers []string
	// Breaking change flag (optional)
	BreakingChanges bool
}

func ParseCommitMsg added in v1.1.0

func ParseCommitMsg(msg string) *CommitMessageOption

type CommitType

type CommitType int
const (
	BuildCommit CommitType = iota
	CiCommit
	ChoreCommit
	DocCommit
	FeatureCommit
	FixCommit
	NilCommit
	PerfCommit
	RefactorCommit
	StyleCommit
	TestCommit
)

func FindCommitType

func FindCommitType(str string) CommitType

Extract type from string

func (CommitType) String

func (b CommitType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL