config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	Name          string         `yaml:"name" mapstructure:"name"`
	Directory     string         `yaml:"directory" mapstructure:"directory"`
	DefaultLabels string         `yaml:"default_labels" mapstructure:"default_labels"`
	ReadyLabel    string         `yaml:"ready_label" mapstructure:"ready_label"`
	ReadyStatus   string         `yaml:"ready_status" mapstructure:"ready_status"`
	UnreadyLabel  string         `yaml:"unready_label" mapstructure:"unready_label"`
	UnreadyStatus string         `yaml:"unready_status" mapstructure:"unready_status"`
	GithubRepo    string         `yaml:"github_repo" mapstructure:"github_repo"`
	GitlabRepo    string         `yaml:"gitlab_repo" mapstructure:"gitlab_repo"`
	DefaultBranch string         `yaml:"default_branch" mapstructure:"default_branch"`
	Worktree      WorktreeConfig `yaml:"worktree,omitempty" mapstructure:"worktree"`
}

Repository represents a single repository configuration

func (*Repository) IsCodeRepo added in v0.6.1

func (r *Repository) IsCodeRepo() bool

IsCodeRepo returns true if the repository has a directory configured (i.e., it's a code repo)

type Settings

type Settings struct {
	ReadyLabel    string         `yaml:"ready_label" mapstructure:"ready_label"`
	ReadyStatus   string         `yaml:"ready_status" mapstructure:"ready_status"`
	UnreadyLabel  string         `yaml:"unready_label" mapstructure:"unready_label"`
	UnreadyStatus string         `yaml:"unready_status" mapstructure:"unready_status"`
	Worktree      WorktreeConfig `yaml:"worktree,omitempty" mapstructure:"worktree"`
	Repositories  []Repository   `yaml:"repositories" mapstructure:"repositories"`
}

Settings represents the root configuration

func Load

func Load() (*Settings, error)

Load reads the configuration from the specified file

func (*Settings) GetRepo

func (s *Settings) GetRepo(name string) *Repository

GetRepo returns a repository by name

func (*Settings) GetRepoNames

func (s *Settings) GetRepoNames() []string

GetRepoNames returns a list of repository names

func (*Settings) ResolveDefaultBranch added in v0.7.0

func (s *Settings) ResolveDefaultBranch(repo *Repository) string

ResolveDefaultBranch returns the default branch for a repo. Resolution order: per-repo worktree > per-repo default branch > global worktree > "main"

func (*Settings) ResolveWorktreePath added in v0.7.0

func (s *Settings) ResolveWorktreePath(repo *Repository) string

ResolveWorktreePath returns the worktree base path for a repo. Resolution order: per-repo > global > default (<repo-dir>/.worktrees)

type WorktreeConfig added in v0.7.0

type WorktreeConfig struct {
	Path          string `yaml:"path" mapstructure:"path"`
	DefaultBranch string `yaml:"default_branch" mapstructure:"default_branch"`
}

WorktreeConfig represents worktree configuration

Jump to

Keyboard shortcuts

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