Documentation
¶
Overview ¶
Package projectconfig handles project-level configuration (.gitscrum.yml)
Index ¶
Constants ¶
const ( // ConfigFileName is the project config file name ConfigFileName = ".gitscrum.yml" // AltConfigFileName is the alternative config file name AltConfigFileName = ".gitscrum.yaml" )
Variables ¶
This section is empty.
Functions ¶
func Exists ¶
func Exists() bool
Exists checks if a project config file exists in the current directory tree
func FindConfigFile ¶
FindConfigFile searches for .gitscrum.yml starting from startPath up to root
func GetConfigPath ¶
func GetConfigPath() string
GetConfigPath returns the path where config was found, or empty string
Types ¶
type AutomationConfig ¶
type AutomationConfig struct {
// Move task to column on PR open
OnPROpen string `yaml:"on_pr_open,omitempty"`
// Move task to column on PR merge
OnPRMerge string `yaml:"on_pr_merge,omitempty"`
// Move task to column on PR close (without merge)
OnPRClose string `yaml:"on_pr_close,omitempty"`
// Move task to column on deploy to staging
OnDeployStaging string `yaml:"on_deploy_staging,omitempty"`
// Move task to column on deploy to production
OnDeployProd string `yaml:"on_deploy_prod,omitempty"`
// Complete task on PR merge
CompleteOnMerge bool `yaml:"complete_on_merge,omitempty"`
}
AutomationConfig configures automation behavior
type BranchConfig ¶
type BranchConfig struct {
// Prefix patterns for different task types
// e.g., feature/ → feature, bugfix/ → bug
Prefixes map[string]string `yaml:"prefixes,omitempty"`
// Default prefix when creating branches
DefaultPrefix string `yaml:"default_prefix,omitempty"`
// Include task title in branch name
IncludeTitle bool `yaml:"include_title,omitempty"`
// Max branch name length
MaxLength int `yaml:"max_length,omitempty"`
}
BranchConfig configures branch naming conventions
type HooksConfig ¶
type HooksConfig struct {
// Prepend task code to commit messages
PrependTaskCode bool `yaml:"prepend_task_code,omitempty"`
// Commit message format: "[CODE] message" or "CODE: message"
CommitFormat string `yaml:"commit_format,omitempty"`
// Validate task exists before push
ValidateOnPush bool `yaml:"validate_on_push,omitempty"`
// Show task info on checkout
ShowTaskOnCheckout bool `yaml:"show_task_on_checkout,omitempty"`
}
HooksConfig configures git hooks behavior
type ProjectConfig ¶
type ProjectConfig struct {
// Version of the config schema
Version string `yaml:"version,omitempty"`
// Workspace slug for this project
Workspace string `yaml:"workspace,omitempty"`
// Project slug for this project
Project string `yaml:"project,omitempty"`
// Branch patterns for automatic task detection
Branch BranchConfig `yaml:"branch,omitempty"`
// Timer settings
Timer TimerConfig `yaml:"timer,omitempty"`
// Hooks configuration
Hooks HooksConfig `yaml:"hooks,omitempty"`
// Labels to apply automatically
Labels []string `yaml:"labels,omitempty"`
// Custom task code pattern (regex)
TaskCodePattern string `yaml:"task_code_pattern,omitempty"`
// Team configuration
Team TeamConfig `yaml:"team,omitempty"`
// Automation settings
Automation AutomationConfig `yaml:"automation,omitempty"`
}
ProjectConfig holds project-level configuration This is read from .gitscrum.yml in the project root
func Init ¶
func Init(workspace, project string) (*ProjectConfig, error)
Init creates a new .gitscrum.yml file with sensible defaults
func Load ¶
func Load() (*ProjectConfig, error)
Load reads the project configuration from the current directory or its parents
func LoadFromFile ¶
func LoadFromFile(path string) (*ProjectConfig, error)
LoadFromFile reads the project configuration from a specific file
func LoadFromPath ¶
func LoadFromPath(startPath string) (*ProjectConfig, error)
LoadFromPath reads the project configuration starting from a given path
func (*ProjectConfig) Merge ¶
func (c *ProjectConfig) Merge(globalWorkspace, globalProject string) (workspace, project string)
Merge combines project config with global config, project takes precedence
func (*ProjectConfig) Save ¶
func (c *ProjectConfig) Save(path string) error
Save writes the configuration to a file
type TeamConfig ¶
type TeamConfig struct {
// Default assignee for new tasks
DefaultAssignee string `yaml:"default_assignee,omitempty"`
// Reviewers to request on PRs
Reviewers []string `yaml:"reviewers,omitempty"`
}
TeamConfig configures team-specific settings
type TimerConfig ¶
type TimerConfig struct {
// Auto-start timer when switching to task branch
AutoStart bool `yaml:"auto_start,omitempty"`
// Auto-stop timer when switching away from task branch
AutoStop bool `yaml:"auto_stop,omitempty"`
// Minimum duration to log (in minutes)
MinDuration int `yaml:"min_duration,omitempty"`
// Round to nearest (in minutes): 5, 15, 30
RoundTo int `yaml:"round_to,omitempty"`
// Remind to stop timer after X hours of inactivity
RemindAfter int `yaml:"remind_after,omitempty"`
}
TimerConfig configures time tracking behavior