Documentation
¶
Overview ¶
Package config provides configuration loading for Spectr projects. This file handles loading and parsing of spectr.yaml configuration files.
Index ¶
Constants ¶
const DefaultAppendTasksSection = "Automated Tasks"
DefaultAppendTasksSection is the default section name for appended tasks when append_tasks.section is not specified in the config.
Variables ¶
var ErrConfigMalformed = errors.New("config file is malformed")
ErrConfigMalformed is returned when the config file contains invalid YAML.
Functions ¶
This section is empty.
Types ¶
type AppendTasksConfig ¶
type AppendTasksConfig struct {
// Section is the name of the section for appended tasks.
// Defaults to "Automated Tasks" if not specified.
Section string `yaml:"section"`
// Tasks is the list of task descriptions to append.
Tasks []string `yaml:"tasks"`
}
AppendTasksConfig defines the configuration for auto-appending tasks.
func (*AppendTasksConfig) GetSection ¶
func (c *AppendTasksConfig) GetSection() string
GetSection returns the section name, using the default if not specified.
func (*AppendTasksConfig) HasTasks ¶
func (c *AppendTasksConfig) HasTasks() bool
HasTasks returns true if there are tasks to append.
type Config ¶
type Config struct {
// AppendTasks defines tasks to automatically append during accept.
AppendTasks *AppendTasksConfig `yaml:"append_tasks"`
}
Config represents the root configuration structure for spectr.yaml.
func LoadConfig ¶
LoadConfig searches for and loads spectr.yaml from the given directory or any parent directory. Returns nil config (not an error) if no config file is found.