convention

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FixType      = "fix"
	FeatType     = "feat"
	BuildType    = "build"
	ChoreType    = "chore"
	CIType       = "ci"
	DocsType     = "docs"
	StyleType    = "style"
	RefactorType = "refactor"
	PerfType     = "perf"
	TestType     = "test"
	MiscType     = "misc"
)

Variables

View Source
var (
	ErrEmptyCommit = errors.New("empty commit")
)

Functions

This section is empty.

Types

type Commit

type Commit struct {
	// Commit as is
	RawHeader string

	Type  string
	Scope string
}

Commit represens conventional commit

func NewCommit

func NewCommit(c git.Commit) (Commit, error)

NewCommit return conventional commit from git commit

func NewCommitWithOptions

func NewCommitWithOptions(opts ...OptionFn) (result Commit, err error)

NewCommitWithOptions return conventional commit with custom option

func (*Commit) String

func (c *Commit) String() string

type OptionFn

type OptionFn func(*Commit) error

func AddAuthorDate

func AddAuthorDate(gitCommit git.Commit) OptionFn

func GetRawHeader

func GetRawHeader(gitCommit git.Commit) OptionFn

func GetTypeAndScope

func GetTypeAndScope(gitCommit git.Commit) OptionFn

Jump to

Keyboard shortcuts

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