config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGlobal

func InitGlobal(configPath string) error

InitGlobal initializes the global configuration

func WriteDefaultConfig

func WriteDefaultConfig(path string, force bool) error

WriteDefaultConfig writes the embedded default config to a file

Types

type Config

type Config struct {
	PromptTemplates         map[string]PromptTemplate `yaml:"prompt_templates"`
	SemanticReleasePrefixes []SemanticReleasePrefix   `yaml:"semantic_release_prefixes"`
}

Config represents the entire configuration

func Get

func Get() *Config

Get returns the global configuration instance

func Load

func Load(configPath string) (*Config, error)

Load loads the configuration from a file or uses the default embedded config

func LoadDefault

func LoadDefault() (*Config, error)

LoadDefault loads the default embedded configuration

func (*Config) BuildPrompt

func (c *Config) BuildPrompt(lang string, branch string, diff string) string

BuildPrompt builds a prompt for commit message generation using template replacement

func (*Config) BuildPromptEnglish

func (c *Config) BuildPromptEnglish(branch string, diff string) string

BuildPromptEnglish builds an English prompt for commit message generation This is a convenience method that calls BuildPrompt with "english" language

func (*Config) GetPrefixList

func (c *Config) GetPrefixList() []string

GetPrefixList returns a list of prefix strings (e.g., "feat:", "fix:")

type PromptTemplate

type PromptTemplate struct {
	Template   string   `yaml:"template"`
	Guidelines []string `yaml:"guidelines"`
}

PromptTemplate represents a template for generating commit messages

type SemanticReleasePrefix

type SemanticReleasePrefix struct {
	Type          string `yaml:"type"`
	Emoji         string `yaml:"emoji"`
	DescriptionJA string `yaml:"description_ja"`
	DescriptionEN string `yaml:"description_en"`
}

SemanticReleasePrefix represents a semantic release prefix type

Jump to

Keyboard shortcuts

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