config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BusFactor

type BusFactor struct {
	Critical float64 `yaml:"critical"`
	High     float64 `yaml:"high"`
}

type Config

type Config struct {
	Tau                  float64              `yaml:"tau"`
	SampleSize           int                  `yaml:"sample_size"`
	DebtThreshold        int                  `yaml:"debt_threshold"`
	ExcludeFilePatterns  []string             `yaml:"exclude_file_patterns"`
	ArchitecturePatterns []string             `yaml:"architecture_patterns"`
	BlameExtensions      []string             `yaml:"blame_extensions"`
	ExcludeAuthors       []string             `yaml:"exclude_authors"`
	Aliases              map[string]string    `yaml:"aliases"`
	Weights              Weights              `yaml:"weights"`
	BusFactor            BusFactor            `yaml:"bus_factor"`
	DefaultDomains       *bool                `yaml:"default_domains"`
	Domains              DomainsConfig        `yaml:"domains"`
	Teams                map[string]TeamEntry `yaml:"teams"`
	BreadthMax           int                  `yaml:"breadth_max"`
	ProductionDailyRef   float64              `yaml:"production_daily_ref"`
	ExcludeRepos         []string             `yaml:"exclude_repos"`
	ActiveDays           int                  `yaml:"active_days"`
	BlameTimeout         int                  `yaml:"blame_timeout"`
}

func Default

func Default() *Config

func Load

func Load(path string, explicit bool) (*Config, error)

Load reads a config file. If explicit is true (user passed --config), a missing file is an error. Otherwise, a missing file returns defaults.

func (*Config) CustomExtensions

func (c *Config) CustomExtensions() map[string][]string

CustomExtensions returns a map of domain names to their custom extension lists. Used with domain.BuildExtMap to create the merged extension-to-domain map.

func (*Config) IsExcludedAuthor

func (c *Config) IsExcludedAuthor(name string) bool

func (*Config) IsExcludedRepo

func (c *Config) IsExcludedRepo(repoName string) bool

func (*Config) ResolveAuthor

func (c *Config) ResolveAuthor(name string) string

func (*Config) UseDefaultDomains

func (c *Config) UseDefaultDomains() bool

UseDefaultDomains returns whether built-in domain extension mappings should be used. Defaults to true when default_domains is not set in config.

func (*Config) Validate

func (c *Config) Validate() error

type DomainEntry

type DomainEntry struct {
	Repos      []string `yaml:"repos"`
	Extensions []string `yaml:"extensions"`
}

DomainEntry defines repo patterns and file extensions for a domain.

func (*DomainEntry) UnmarshalYAML

func (e *DomainEntry) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML supports both legacy format (list of strings) and new format (object).

type DomainsConfig

type DomainsConfig map[string]DomainEntry

DomainsConfig maps domain names to their configuration. Supports both legacy format (list of repo patterns) and new format (object with repos + extensions).

legacy:  backend: [api, worker]
new:     mobile: { repos: [ios-app], extensions: [.swift, .kt] }

type TeamEntry

type TeamEntry struct {
	Domain  string   `yaml:"domain"`
	Members []string `yaml:"members"`
}

TeamEntry defines a named team with its members and optional domain scope.

type Weights

type Weights struct {
	Production       float64 `yaml:"production"`
	Quality          float64 `yaml:"quality"`
	Survival         float64 `yaml:"survival"`
	Design           float64 `yaml:"design"`
	Breadth          float64 `yaml:"breadth"`
	DebtCleanup      float64 `yaml:"debt_cleanup"`
	Indispensability float64 `yaml:"indispensability"`
}

Jump to

Keyboard shortcuts

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