Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MergeMethodSquash = "squash"
	MergeMethodRebase = "rebase"
)

Land merge method constants

View Source
const (
	ApprovalStrict = "strict"
	ApprovalPrompt = "prompt"
	ApprovalNone   = "none"
)

Land approval mode constants

View Source
const (
	CIModeRequired = "required"
	CIModeAll      = "all"
	CIModeNone     = "none"
)

Land CI mode constants

Variables

This section is empty.

Functions

func GetConfigFilePath

func GetConfigFilePath() string

GetConfigFilePath returns the path to the config file being used

Types

type Config

type Config struct {
	GitHub GitHubConfig `mapstructure:"github"`
	Diff   DiffConfig   `mapstructure:"diff"`
	Land   LandConfig   `mapstructure:"land"`
	Test   TestConfig   `mapstructure:"test"`
	Lint   LintConfig   `mapstructure:"lint"`
	Output OutputConfig `mapstructure:"output"`
}

Config represents the application configuration

func Get

func Get() *Config

Get returns the loaded configuration

func Load

func Load() (*Config, error)

Load loads the configuration from files and environment variables

func (*Config) GetMegaLinterConfigPath

func (c *Config) GetMegaLinterConfigPath() (string, bool, error)

GetMegaLinterConfigPath returns the path/URL to the mega-linter config file Returns (path/url, isURL, error) If no local config exists, returns the GitHub raw URL to gh-arc's default config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type DiffConfig

type DiffConfig struct {
	CreateAsDraft         bool   `mapstructure:"createAsDraft"`
	AutoUpdatePR          bool   `mapstructure:"autoUpdatePR"`
	IncludeCommitMessages bool   `mapstructure:"includeCommitMessages"`
	EnableStacking        bool   `mapstructure:"enableStacking"`
	DefaultBase           string `mapstructure:"defaultBase"`
	ShowStackingWarnings  bool   `mapstructure:"showStackingWarnings"`
	TemplatePath          string `mapstructure:"templatePath"`
	RequireTestPlan       bool   `mapstructure:"requireTestPlan"`
	LinearEnabled         bool   `mapstructure:"linearEnabled"`
	LinearDefaultProject  string `mapstructure:"linearDefaultProject"`
	// Auto-branch from main settings
	AutoCreateBranchFromMain  bool   `mapstructure:"autoCreateBranchFromMain"`
	AutoBranchNamePattern     string `mapstructure:"autoBranchNamePattern"`
	StaleRemoteThresholdHours int    `mapstructure:"staleRemoteThresholdHours"`
}

DiffConfig contains PR creation settings

type GitHubConfig

type GitHubConfig struct {
	DefaultBranch      string   `mapstructure:"defaultBranch"`
	DefaultReviewers   []string `mapstructure:"defaultReviewers"`
	AutoAssignReviewer bool     `mapstructure:"autoAssignReviewer"`
}

GitHubConfig contains GitHub-related settings

type LandConfig

type LandConfig struct {
	DefaultMergeMethod string `mapstructure:"defaultMergeMethod"`
	DeleteLocalBranch  bool   `mapstructure:"deleteLocalBranch"`
	RequireApproval    string `mapstructure:"requireApproval"`
	RequireCI          string `mapstructure:"requireCI"`
}

LandConfig contains merge settings

type LintConfig

type LintConfig struct {
	Runners    []LintRunner     `mapstructure:"runners"`
	MegaLinter MegaLinterConfig `mapstructure:"megaLinter"`
}

LintConfig contains linting settings

type LintRunner

type LintRunner struct {
	Name       string   `mapstructure:"name"`
	Command    string   `mapstructure:"command"`
	Args       []string `mapstructure:"args"`
	WorkingDir string   `mapstructure:"workingDir"`
	AutoFix    bool     `mapstructure:"autoFix"`
}

LintRunner represents a linter runner configuration

type MegaLinterConfig

type MegaLinterConfig struct {
	Enabled   string `mapstructure:"enabled"` // auto, true, false
	Config    string `mapstructure:"config"`
	FixIssues bool   `mapstructure:"fixIssues"`
}

MegaLinterConfig contains mega-linter specific settings

type OutputConfig

type OutputConfig struct {
	Verbose bool `mapstructure:"verbose"`
	Quiet   bool `mapstructure:"quiet"`
	JSON    bool `mapstructure:"json"`
	Color   bool `mapstructure:"color"`
}

OutputConfig contains output preferences

type TestConfig

type TestConfig struct {
	Runners []TestRunner `mapstructure:"runners"`
}

TestConfig contains test execution settings

type TestRunner

type TestRunner struct {
	Name       string   `mapstructure:"name"`
	Command    string   `mapstructure:"command"`
	Args       []string `mapstructure:"args"`
	WorkingDir string   `mapstructure:"workingDir"`
	Timeout    string   `mapstructure:"timeout"`
}

TestRunner represents a test runner configuration

Jump to

Keyboard shortcuts

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