Documentation
¶
Index ¶
- Constants
- func CheckCommitMessage(file string)
- func CheckGitProject()
- func CheckStagedFiles() bool
- func Checkout(prefix CommitType, branch string)
- func Commit(cm *Message)
- func GenSOB() string
- func GetCurrentBranch() string
- func GetLastCommitInfo() *[]string
- func InputBody() string
- func InputFooter() string
- func InputScope() string
- func InputSubject() string
- func Push()
- func Rebase(sourceBranch string, targetBranch string)
- type CommitType
- type Message
- type RepoType
- type TypeMessage
Constants ¶
View Source
const Cmd = "git"
View Source
const CommitMessagePattern = `^(?:fixup!\s*)?(\w*)(\(([\w\$\.\*/-].*)\))?\: (.*)|^Merge\ branch(.*)`
View Source
const CommitTpl = `{{ .Type }}({{ .Scope }}): {{ .Subject }}
{{ .Body }}
{{ .Footer }}
{{ .Sob }}
`
Variables ¶
This section is empty.
Functions ¶
func CheckCommitMessage ¶
func CheckCommitMessage(file string)
func CheckGitProject ¶
func CheckGitProject()
func CheckStagedFiles ¶
func CheckStagedFiles() bool
func Checkout ¶
func Checkout(prefix CommitType, branch string)
func GetCurrentBranch ¶
func GetCurrentBranch() string
func GetLastCommitInfo ¶
func GetLastCommitInfo() *[]string
Types ¶
type CommitType ¶
type CommitType string
const ( FEAT CommitType = "feat" FIX CommitType = "fix" DOCS CommitType = "docs" STYLE CommitType = "style" REFACTOR CommitType = "refactor" TEST CommitType = "test" CHORE CommitType = "chore" PERF CommitType = "perf" HOTFIX CommitType = "hotfix" EXIT CommitType = "exit" )
type Message ¶
type Message struct { Type CommitType Scope string Subject string Body string Sob string }
type TypeMessage ¶
type TypeMessage struct { Type CommitType ZHDescription string ENDescription string }
Click to show internal directories.
Click to hide internal directories.