config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config provides configuration loading for Spectr projects. This file handles loading and parsing of spectr.yaml configuration files.

Index

Constants

View Source
const DefaultAppendTasksSection = "Automated Tasks"

DefaultAppendTasksSection is the default section name for appended tasks when append_tasks.section is not specified in the config.

Variables

View Source
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

func LoadConfig(startDir string) (*Config, error)

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.

Jump to

Keyboard shortcuts

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