Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WarnWriter io.Writer = os.Stderr
WarnWriter is the destination for config warnings (e.g. unknown fields). It defaults to os.Stderr but can be overridden in tests.
Functions ¶
func ReadLanguageOnly ¶ added in v1.0.0
ReadLanguageOnly reads only the language field from .lorerc without full config loading. This is used before Cobra command construction so that i18n.T() returns the correct language for command Short/Long strings. Returns "" if the file is absent, unreadable, or has no language field. No validation, no Viper, no error surfacing — silent fallback.
func RegisterFlags ¶
RegisterFlags declares persistent CLI flags on the given command. Called by cmd/root.go — no Viper dependency is exposed.
Types ¶
type AIConfig ¶
type AIConfig struct {
Provider string `yaml:"provider" mapstructure:"provider"`
Model string `yaml:"model" mapstructure:"model"`
APIKey string `yaml:"api_key" mapstructure:"api_key"`
Endpoint string `yaml:"endpoint" mapstructure:"endpoint"`
Timeout time.Duration `yaml:"timeout" mapstructure:"timeout"`
}
type AngelaConfig ¶
type Config ¶
type Config struct {
Language string `yaml:"language" mapstructure:"language"`
AI AIConfig `yaml:"ai"`
Angela AngelaConfig `yaml:"angela"`
Decision DecisionConfig `yaml:"decision"`
Notification NotificationConfig `yaml:"notification"`
Templates TemplatesConfig `yaml:"templates"`
Hooks HooksConfig `yaml:"hooks"`
Output OutputConfig `yaml:"output"`
}
func LoadFromDir ¶
LoadFromDir loads configuration from a specific directory.
type ConfigReport ¶ added in v1.0.0
type ConfigReport struct {
Valid bool // true if no errors (warnings are OK)
Warnings []string // unknown fields, suggestions
Errors []string // invalid values, parse errors
Active map[string]string // resolved values after cascade
}
ConfigReport holds the results of config validation.
func ValidateConfig ¶ added in v1.0.0
func ValidateConfig(dir string) *ConfigReport
ValidateConfig validates .lorerc and .lorerc.local files in dir. It checks for unknown fields (with "did you mean?" suggestions) and collects the active resolved values.
func (*ConfigReport) OK ¶ added in v1.0.0
func (r *ConfigReport) OK() bool
OK returns true when validation found no errors and no warnings.
type DecisionConfig ¶ added in v1.0.0
type DecisionConfig struct {
ThresholdFull int `yaml:"threshold_full" mapstructure:"threshold_full"`
ThresholdReduced int `yaml:"threshold_reduced" mapstructure:"threshold_reduced"`
ThresholdSuggest int `yaml:"threshold_suggest" mapstructure:"threshold_suggest"`
AlwaysAsk []string `yaml:"always_ask" mapstructure:"always_ask"`
AlwaysSkip []string `yaml:"always_skip" mapstructure:"always_skip"`
CriticalScopes []string `yaml:"critical_scopes" mapstructure:"critical_scopes"`
Learning bool `yaml:"learning" mapstructure:"learning"`
LearningMinCommits int `yaml:"learning_min_commits" mapstructure:"learning_min_commits"`
}
type HooksConfig ¶
type NotificationConfig ¶ added in v1.0.0
type OutputConfig ¶
type TemplatesConfig ¶
type TemplatesConfig struct {
Dir string `yaml:"dir" mapstructure:"dir"`
}