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

config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Thresholds ThresholdConfig            `toml:"thresholds"`
	Scan       ScanConfig                 `toml:"scan"`
	Context    ContextConfig              `toml:"context"`
	PerPath    map[string]ThresholdConfig `toml:"per-path"`
}

Config holds all adit configuration.

func Default

func Default() Config

Default returns a Config with sensible defaults.

func Load

func Load(startDir string) (Config, error)

Load finds and loads configuration, walking up from startDir. Checks adit.toml first, then pyproject.toml [tool.adit]. Falls back to defaults for any missing values.

func LoadFile

func LoadFile(path string) (Config, error)

LoadFile loads configuration from a specific file path.

func (Config) ThresholdsForPath

func (c Config) ThresholdsForPath(filePath string) ThresholdConfig

ThresholdsForPath returns the thresholds that apply to a given file path. If a per-path override matches, its non-zero values override the base thresholds.

type ContextConfig

type ContextConfig struct {
	WindowTokens   int     `toml:"window_tokens"`
	UsableFraction float64 `toml:"usable_fraction"`
}

ContextConfig holds informational context window settings.

type ScanConfig

type ScanConfig struct {
	Languages []string `toml:"languages"`
	Exclude   []string `toml:"exclude"`
}

ScanConfig controls what to scan.

type ThresholdConfig

type ThresholdConfig struct {
	MaxFileLines        int `toml:"max_file_lines"`
	MaxContextReads     int `toml:"max_context_reads"`
	MaxUnnecessaryReads int `toml:"max_unnecessary_reads"`
	MaxAmbiguityDefs    int `toml:"max_ambiguity_defs"`
	MaxBlastRadius      int `toml:"max_blast_radius"`
	MaxCycleLength      int `toml:"max_cycle_length"`
}

ThresholdConfig holds enforcement thresholds.

Jump to

Keyboard shortcuts

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