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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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