Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCommitTitle(_type string, scope string, isBreaking bool, desc string, gitmoji Gitmoji, ...) string
- func CacheGitmojis(gitmojis Gitmojis)
- func CreateAllHookFiles() error
- func ExecuteCommit(title string, body string, config Config)
- func HookFilesExistent() ([]string, error)
- func InitConfig()
- func LoadConfig(configPaths []string) (err error)
- func RemoveAllHookFiles() error
- func ToggleDebug(debug bool)
- func UpdateConfig(config Config, isGlobalConfig bool)
- type CommitFlagName
- type CommitMessageSource
- type CommitType
- type CommitValues
- type Config
- type ConfigEnum
- type EmojiCommitFormats
- type Gitmoji
- type Gitmojis
- type InitialCommitValues
- type ParsedMessages
- type PlainFormatter
- type TextInputData
- type TextInputRes
- type YesNo
Constants ¶
View Source
const DefaultGitmojiApiUrl = "https://gitmoji.dev/api/gitmojis"
DefaultGitmojiApiUrl The Url to reach the grimoji API
View Source
const DefaultGitmojiUrl = "https://gitmoji.dev/"
DefaultGitmojiUrl The URL to reach the gitmoji website
View Source
const EnvPrefix = "GO_GITMOJI_CLI"
View Source
const ProgramName = "go-gitmoji-cli"
Variables ¶
View Source
var CommitSHA = ""
CommitSHA as provided by goreleaser.
View Source
var ConfigIsInit = false
View Source
var ErrInvalidGitHooksDirectoryPath = errors.New("invalid git hooks directory path")
View Source
var Version = ""
Version as provided by goreleaser.
Functions ¶
func BuildCommitTitle ¶
func CacheGitmojis ¶
func CacheGitmojis(gitmojis Gitmojis)
func CreateAllHookFiles ¶
func CreateAllHookFiles() error
func ExecuteCommit ¶
func HookFilesExistent ¶
func InitConfig ¶
func InitConfig()
func LoadConfig ¶
func RemoveAllHookFiles ¶
func RemoveAllHookFiles() error
func ToggleDebug ¶
func ToggleDebug(debug bool)
func UpdateConfig ¶
Types ¶
type CommitFlagName ¶
type CommitFlagName string
const ( SCOPE CommitFlagName = "Scope" DESC CommitFlagName = "Desc" TYPE CommitFlagName = "type" BODY CommitFlagName = "body" IS_BREAKING CommitFlagName = "is-breaking" )
type CommitMessageSource ¶
type CommitMessageSource string
const ( MESSAGE CommitMessageSource = "message" TEMPLATE CommitMessageSource = "template" MERGE CommitMessageSource = "merge" SQUASH CommitMessageSource = "squash" COMMIT CommitMessageSource = "commit" )
type CommitType ¶
type CommitType struct { Type string `mapstructure:"TYPE" json:"type"` Desc string `mapstructure:"DESC" json:"desc"` }
func DefaultCommitTypes ¶
func DefaultCommitTypes() []CommitType
func (CommitType) Description ¶
func (i CommitType) Description() string
func (CommitType) FilterValue ¶
func (i CommitType) FilterValue() string
func (CommitType) Title ¶
func (i CommitType) Title() string
type CommitValues ¶
func CreateMessage ¶
func CreateMessage(inputsRes []TextInputRes, selectedGitmoji Gitmoji, initialCommitValues InitialCommitValues, config Config, isBreaking bool) CommitValues
type Config ¶
type Config struct { AutoAdd bool `mapstructure:"AUTO_ADD" json:"auto_add"` AutoSign bool `mapstructure:"AUTO_SIGN" json:"auto_sign"` AutoSignature bool `mapstructure:"AUTO_SIGNATURE" json:"auto_signature"` EmojiFormat EmojiCommitFormats `mapstructure:"EMOJI_FORMAT" json:"emoji_format"` ScopePrompt bool `mapstructure:"SCOPE_PROMPT" json:"scope_prompt"` BodyPrompt bool `mapstructure:"BODY_PROMPT" json:"body_prompt"` CapitalizeTitle bool `mapstructure:"CAPITALIZE_TITLE" json:"capitalize_title"` GitmojisUrl string `mapstructure:"GITMOJIS_URL" json:"gitmojis_url"` UseDefaultGitMessages bool `mapstructure:"USE_DEFAULT_GIT_MESSAGES" json:"use_default_git_messages"` Debug bool `mapstructure:"DEBUG" json:"debug"` }
func GetCurrentConfig ¶
type ConfigEnum ¶
type ConfigEnum string
const ( AUTO_ADD ConfigEnum = "AUTO_ADD" AUTO_SIGN ConfigEnum = "AUTO_SIGN" AUTO_SIGNATURE ConfigEnum = "AUTO_SIGNATURE" EMOJI_FORMAT ConfigEnum = "EMOJI_FORMAT" SCOPE_PROMPT ConfigEnum = "SCOPE_PROMPT" GITMOJIS_URL ConfigEnum = "GITMOJIS_URL" BODY_PROMPT ConfigEnum = "BODY_PROMPT" CAPITALIZE_TITLE ConfigEnum = "CAPITALIZE_TITLE" USE_DEFAULT_GIT_MESSAGES ConfigEnum = "USE_DEFAULT_GIT_MESSAGES" DEBUG ConfigEnum = "DEBUG" )
type EmojiCommitFormats ¶
type EmojiCommitFormats string
const ( CODE EmojiCommitFormats = "code" EMOJI EmojiCommitFormats = "emoji" )
func (EmojiCommitFormats) Description ¶
func (i EmojiCommitFormats) Description() string
func (EmojiCommitFormats) FilterValue ¶
func (i EmojiCommitFormats) FilterValue() string
func (EmojiCommitFormats) Title ¶
func (i EmojiCommitFormats) Title() string
type Gitmoji ¶
type Gitmoji struct { Emoji string `mapstructure:"emoji" json:"emoji"` Entity string `mapstructure:"entity" json:"entity"` Code string `mapstructure:"code" json:"code"` Desc string `mapstructure:"description" json:"description"` Name string `mapstructure:"name" json:"name"` Semver string `mapstructure:"semver" json:"semver"` }
func FindGitmoji ¶
func (Gitmoji) Description ¶
func (Gitmoji) FilterValue ¶
type Gitmojis ¶
type Gitmojis struct {
Gitmojis []Gitmoji `json:"gitmojis"`
}
func GetGitmojis ¶
func GetGitmojisCache ¶
func UpdateGitmojis ¶
type InitialCommitValues ¶
type InitialCommitValues struct { Type string Scope string Desc string Body string Gitmoji *Gitmoji }
func (InitialCommitValues) BuildTextInputsData ¶
func (i InitialCommitValues) BuildTextInputsData(config Config) []TextInputData
type ParsedMessages ¶
type ParsedMessages struct { Type string Scope string Desc string IsBreaking bool Gitmoji *Gitmoji Body string }
func ParseCommitMessages ¶
func ParseCommitMessages(messages []string, gitmojis []Gitmoji) (*ParsedMessages, error)
func ReadAndParseCommitEditMsg ¶
func ReadAndParseCommitEditMsg(filePath string, gitmojis []Gitmoji) (*ParsedMessages, error)
type PlainFormatter ¶
type PlainFormatter struct { }
type TextInputData ¶
type TextInputRes ¶
Click to show internal directories.
Click to hide internal directories.