config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

internal/config/config.go

Index

Constants

View Source
const (
	DefaultConfigFileName        = ".contextvibes.yaml"
	DefaultBranchNamePattern     = `^((feature|fix|docs|format)/.+)$`
	DefaultCommitMessagePattern  = `^(BREAKING|feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-zA-Z0-9\-_]+\))?:\s.+`
	DefaultGitRemote             = "origin"
	DefaultGitMainBranch         = "main"
	UltimateDefaultAILogFilename = "contextvibes_ai_trace.log"
)

Variables

This section is empty.

Functions

func FindRepoRootConfigPath

func FindRepoRootConfigPath(execClient *exec.ExecutorClient) (string, error)

FindRepoRootConfigPath now takes an ExecutorClient to find the repo root.

Types

type Config

type Config struct {
	Git        GitSettings     `yaml:"git,omitempty"`
	Logging    LoggingSettings `yaml:"logging,omitempty"`
	Validation struct {
		BranchName    ValidationRule `yaml:"branchName,omitempty"`
		CommitMessage ValidationRule `yaml:"commitMessage,omitempty"`
	} `yaml:"validation,omitempty"`
}

func GetDefaultConfig

func GetDefaultConfig() *Config

func LoadConfig

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

func MergeWithDefaults

func MergeWithDefaults(loadedCfg *Config, defaultConfig *Config) *Config

type GitSettings

type GitSettings struct {
	DefaultRemote     string `yaml:"defaultRemote,omitempty"`
	DefaultMainBranch string `yaml:"defaultMainBranch,omitempty"`
}

type LoggingSettings

type LoggingSettings struct {
	DefaultAILogFile string `yaml:"defaultAILogFile,omitempty"`
}

type ValidationRule

type ValidationRule struct {
	Enable  *bool  `yaml:"enable,omitempty"`
	Pattern string `yaml:"pattern,omitempty"`
}

Jump to

Keyboard shortcuts

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