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 Load ¶
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 (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. Patterns are checked in sorted order for deterministic behavior.
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 {
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"`
MaxNestingDepth int `toml:"max_nesting_depth"` // 0 = not enforced
MaxParams int `toml:"max_params"` // 0 = not enforced
}
ThresholdConfig holds enforcement thresholds. Zero values mean "not enforced" (except MaxCycleLength where 0 = no cycles allowed).